-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Profunctor combinators #77
Comments
Thanks @guaraqe I opened an issue in cmk/profunctor-optics#26 to ask about that Traversal situation. |
Hmm. I just noticed that |
I think it was just not written: liftTraverse ::
Functor f =>
(p a b -> p (t a) (t b)) ->
Cayley f p a b -> Cayley f p (t a) (t b)
liftTraverse f (Cayley p) = Cayley (fmap f p) |
@guaraqe Nice :) Do you want to open a PR to profunctors with that? |
Done: ekmett/profunctors#82 |
In another profunctor optics library, the definition I proposed above is the one used for The library is from the author of "Optics by example", so there are good chances this is good. |
This should be merged soon. |
Are you just waiting for the merge of folds? |
These are lens-like combinators that could be used for manipulating arrows in funflow and porcupine. They are based on the code in the profunctor-optics library.
The definition of an
Optic
in this library is:Since these optics are functions, they can be composed with the
(.)
operator.Lens
The definition of a
Lens
in the library is:which means that the two functions that compose the
Strong
class can be considered as lenses:Other lenses can be constructed using the general
lens
function.Prism
The definition of a
Prism
in the library is:which means that the two functions that compose the
Choice
class can be considered as prisms:Other prisms can be constructed using the general
prism
function.Traversal
The definition of a
Traversal
in the library is different from what I would expect. For a good reason I imagine. But if we keep in the same track as in the other optics, we can take inspiration from theTraversing
class, and define for ourselves the following:which would mean that the base function from the
Traversing
class defines a traversal:Other traversals can be constructed using the
wander
function, that belongs to the same class:The text was updated successfully, but these errors were encountered: