Skip to content

Casting between list and IROL needed? #2

Description

@ArbilGit

Hi! A quick question please, something I've struggled to make work for some time. I have

type Wrapped = {nums: int list}
let numsL p = Optic.lens (fun w -> w.nums) (fun v w -> {w with nums = v}) p
let wrapped = {nums = [1;7]}

Now this composition doesn't compile

Optic.collect (numsL << Optic.elemsT) wrapped

with The type 'int list' does not match the type 'Optic.IROL<'a>'

Do I need explicit casting here, or an isomorphism? Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions