evertedsphere/silica

Beginner lens / optics questions and points of confusion

mrkgnao opened this issue ยท 3 comments

If there's something about optics you don't understand, please talk a little about it below.

Format

Include:

  • the language you're using (Haskell, PureScript, Scala, or something else?)

  • the library or implementation you're using (e.g. lens, microlens, or mezzolens for Haskell, purescript-profunctor-lenses for PureScript, ...)

  • how much experience you have with the language

  • as much other information as possible!

Code samples, type errors, and so on are also good if you have some.

All levels of experience welcome!

The process

Project maintainers will leave a ๐Ÿ‘ reaction to indicate that we understand your question and that it has been added to a list.

This will help keep the issue free of useless "good point!" comments. If we have any further clarifications to ask for, we will do so.

Credits

@modernserf suggested we do this, i.e. collect questions that beginners are likely to have.

Current list

  • I know what lenses are, but what about the other optics? - @modernserf

  • What are lenses for? - @Kansattica

  • What are the alternative implementations to choose from, why are there so many, and what are the differences between them? - @Kansattica

As an absolute Haskell beginner, what problem does this solve? Why would I want to use one of these libraries, and why are there so many of them to choose from?

How are lenses different from getters/setters in OO languages? They do look very much similar.

Are there any "lens laws"?