Add Loop
paf31 opened this issue · 3 comments
paf31 commented
Suggested:
class (Category a, Strong a) <= Loop a where
loop :: forall b c d. a (Tuple b d) (Tuple c d) -> a b cwith laws (cribbed from https://hackage.haskell.org/package/base-4.7.0.2/docs/Control-Arrow.html#t:ArrowLoop):
loop (f <<< first h) = loop f <<< h
loop (f >>> first h) = loop f >>> h.. and the rest which I haven't figured out yet (TODO).
DavidHarrison commented
Does ArrowLoop depend on Haskell's lazy evaluation? It seems that Halogen's loop relies on an initial state.
garyb commented
Does Costrong cover this? unfirst is loop anyway, but there's also unsecond.
paf31 commented
I think it possibly does. I don't fully understand the intent of Costrong yet, so I'm not sure.