Add instances for Profunctor and Traversing.#247
Add instances for Profunctor and Traversing.#247freckletonj wants to merge 1 commit intoivanperez-keera:developfrom
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! |
|
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
FreeTraversingand 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