1

Probably related to What in lens should I use to build a read-only getter by index?

I'm looking for a variant of the lens function that allows me to build a Getter s a from an s -> a. Does something like this exist?

Saurabh Nanda
  • 6,373
  • 5
  • 31
  • 60

1 Answers1

1

You are looking for to, which "build[s] an (index-preserving) Getter from an arbitrary Haskell function".

duplode
  • 33,731
  • 7
  • 79
  • 150