-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add instances for Profunctor and Traversing. #247
base: develop
Are you sure you want to change the base?
Add instances for Profunctor and Traversing. #247
Conversation
updated! So I'm not sure I understand the tradeoff between strict and lazy state. I would guess that laziness might be necessary for ArrowLoop or MonadFix to work properly... But I'm not sure. |
The difference is whether in a state transition the internal state (i.e. the current MSF continuation) is evaluated to WHNF. In most cases this is done automatically on the next tick because it is needed then. |
@turion It's a humble PR, but it should be g2g now! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small comments
You should definitely squash the commits ;) |
add StateT to get types working (needs to be removed) ah, we can't get rid of the newtype StateT cleanup use transformers StateT use strict StateT add backwards compatibility backwards compatibility: Control.Applicative.pure appease our forefathers be satisfied! light refactor
64cee28
to
14f373d
Compare
Good recommendations. And I squashed the commits, but if you haven't seen it yet, I tend to use github's Any other issues you'd like a hand with? |
Looking great! @ivanperez-keera Is this fine to merge for you? I'm only asking since this introduces one dependency (
Right, I've just never used it. And I don't know what the commit message will be in that case.
Any that are open, really :) |
It actually gives you a prompt to write a commit message. Cool I'll take a look at open issues :) |
I'll take a look and get back to you. |
I believe this would make |
This is my first pass at adding Profunctor and Traversing instances.
I'm not 100% positive they're correct, though, some hand-rolled experiments seem to match my intuitions so far.
My interest in these instances stems from https://elvishjerricco.github.io/2017/03/10/profunctors-arrows-and-static-analysis.html. In it he builds a tree from
FreeTraversing
and in breaking it back down is able to build batched effects from singular effects. I'm hoping these instances will help me explore that possibility, we'll see!Related: #224