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
instanceFunctorf=>Monoid (Freefa) wheremempty= empty
mappend=(<|>)mconcat as = from (as >>= to)
where
to (Plus xs) = xs
to x = [x]
from [x] = x
from xs =Plus xs
It's worth pointing out that in your first post, you gave instances for Cofree and in the second one you gave instances for Free. I think the Cofree instances are clearly correct. In fact, I had just come here to request them as you have written them. (I haven't thought as much about the Free instance). @ElvishJerricco or @ekmett, would a PR be accepted for the Cofree instances?
Is there a use for those instances (and similar
Free
instances)?These instances
correspond to
while sadly
Semigroup a => Semigroup (Cofree Maybe a)
does not correspond toSemigroup (NonEmpty a)
.The text was updated successfully, but these errors were encountered: