Review syntax #16

Closed
julien-truffaut opened this Issue Feb 27, 2014 · 3 comments

Projects

None yet

1 participant

@julien-truffaut
Owner

I am not fan of oo as synonym for compose and I don't like that we need to define a new operator to create an AppliedLens (>-), AppliedTraversal (>--) and so on.

Owner

I am thinking of using >> instead oo, so it will look like

Person("Roger", Address(10, "Great street")) >- address >> streetNumber get == 10

and >>L as an alias for lensCompose. I still don't have a good idea to replace >- and >--

Owner

I just updated syntax for lens, traversal, iso and prism. Now there is one operator for each that has an overloaded meaning:

  • alias to compose: lens1 |-> lens2 == lens1 compose lens2
  • create an AppliedX object: s |-> lens == AppliedLens(s, lens)
  • composition between AppliedX objects: appliedLens1 |-> appliedLens2

Here are the four operators:

  • Iso <->
  • Prism <-?
  • Lens |->
  • Traversal |->>

Still need to find some for Getter, Setter and Fold.

Owner

I don't think sure it is worth to have an alias for Getter, Setter and Fold composition as they will probably be used less often than Lens and Traversal.

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