optics-dev / Monocly

Optics experimentation for Dotty
MIT License
32 stars 5 forks source link

Start to document Focus #33

Closed julien-truffaut closed 3 years ago

julien-truffaut commented 3 years ago

This is just a poc to get the ball rolling. Here are couple of points:

  1. I added one section per use case (field of a case class, Option, branch of an enumeration, index in a datastructure).
  2. Each code sample is independant from one another
  3. Each section has a technical details part with info for experienced users, e.g. people who know about the type of underlying optics and polymorphic optics. This could be a link to a more advanced doc instead.
  4. I added withDefault, I think it makes sense to cover the most likely usage for Optiontogether. I will add a ticket.
  5. I used the infix version of Focus because it is shorter and more appealing.