You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't know if this makes sense, but it should work at least for Of and (,). The constraints on f look scary, but they really boil down to f being a bifunctor that's a comonad in its second argument.
unzip:: (Monadm, Bifunctorf, Functor (fb), Comonad (f (a,b)))
=>Stream (f (a,b)) mr->Stream (fa) (Stream (fb) m) runzip= loop where
loop str =case str ofReturn r ->Return r
Effect m ->Effect (liftM loop (lift m))
Step f ->Step. first fst. extend (Effect.Step. first snd)
.fmap (Return. loop) $ f
I don't know if the extra laziness here will cause any performance problems. If it does, and if this idea is actually good for something, we can offer both versions. As with copy, we really only need the power of Extend, not of Comonad.
The text was updated successfully, but these errors were encountered:
I don't know if this makes sense, but it should work at least for
Of
and(,)
. The constraints onf
look scary, but they really boil down tof
being a bifunctor that's a comonad in its second argument.I don't know if the extra laziness here will cause any performance problems. If it does, and if this idea is actually good for something, we can offer both versions. As with
copy
, we really only need the power ofExtend
, not ofComonad
.The text was updated successfully, but these errors were encountered: