ekmett / kan-extensions

Kan extensions, Kan lifts, the Yoneda lemma, and (co)monads generated by a functor
Other
79 stars 33 forks source link

lowerCodensity can be AMPlified #15

Closed treeowl closed 9 years ago

treeowl commented 9 years ago

Currently,

lowerCodensity :: Monad m => Codensity m a -> m a
lowerCodensity a = runCodensity a return

We could AMP that up to

lowerCodensity :: Applicative f => Codensity f a -> f a
lowerCodensity a = runCodensity a pure

Whether that's useful or not is another question, but it's possible.

ekmett commented 9 years ago

Happy to take a patch for it. It doesn't add much but it is correct.

treeowl commented 9 years ago

See PR #16

ekmett commented 9 years ago

Merged