optics-dev / Monocle

Optics library for Scala
https://www.optics.dev/Monocle/
MIT License
1.65k stars 205 forks source link

Communication strategy #1054

Open kenbot opened 3 years ago

kenbot commented 3 years ago

I think the website, scaladoc, code/variable naming, import interface and compiler error messages all have to form one coherent, clearly stated communication strategy for 3.0 release. They all have to make sense with respect to each other, not just themselves.

julien-truffaut commented 3 years ago

Yeah I completely agree. I think what is important is to define a pattern, e.g. select a few features/optics/methods and write the sort of documentation we expect to get for the rest of the library.

For example, it would be great to create a section on the website documenting all the Optics Builder methods. This would include code example, is it available via Focus macro, conditions etc

some

Description Zoom into an Option but only if it is a Some
Available All Optics, ApplyOptics and Focus
Example Focus[User](_.address.some.streetNumber) .replace(4) ...

Then we could reference this documentation in the code

/**  Description | Zoom into an `Option` but only if it is a `Some`
 @see www.optics.dev/optics-builder#some
*/
def some[A1, B1](implicit ev1: A =:= Option[A1], ev2: B =:= Option[B1]): PPrism[S, T, A1, B1] =
julien-truffaut commented 3 years ago

@kenbot do you have an idea how should we do this and communicate about it?

kenbot commented 3 years ago

I think my ideas are pretty aligned with yours. I'd say:

Have "onion rings" of documentation levels, where each level n need not know anything about n+1. Something like: