-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
I don't actually know if this "makes sense", but it works for Of and (,), and it kind of smells right.
copy :: (Monad m, Comonad f) => Stream f m r -> Stream f (Stream f m) r
copy = Effect . return . loop where
loop str = case str of
Return r -> Return r
Effect m -> Effect (fmap loop (lift m))
Step f -> Effect (Step (extend (Return . Step) (fmap loop f)))Comonad is actually overkill; we only really need Extend from Data.Functor.Extend in semigroupoids. Unfortunately, that's not a superclass.
Metadata
Metadata
Assignees
Labels
No labels