Suggestion: Implement `para`/`apo` without unnecessary type constraits. #4

Closed
ppetr opened this Issue Feb 3, 2013 · 1 comment

Comments

Projects
None yet
2 participants
Collaborator

ppetr commented Feb 3, 2013

I was surprised that para needs Unfoldable and ano needs Foldable. It's possible to implement them without it, although much less nicely:

para :: (Base t (t, a) -> a) -> t -> a
para t = p where p x = t . fmap (((,) x) . p) $ project x

apo :: (a -> Base t (Either t a)) -> a -> t
apo g = a where a = embed . (fmap (either id a)) . g
Collaborator

phadej commented Jun 29, 2016

AFAICS this is done?

phadej closed this in 864a063 Jul 5, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment