ekmett / kan-extensions

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

Improve Applicative etc. for Coyoneda #26

Closed treeowl closed 8 years ago

treeowl commented 8 years ago

Reduce <*> and <.> to one fmap application each.

Use underlying definitions of *>, <*, >>, .>, and <. to reduce unnecessary mapping and constructor noise. Define some and many for Alternative based on the definitions in the underlying instance. This cannot be done for Alt.

Applicative f => Applicative (Coyoneda f)

does not give rise to an entailment, so the Applicative method contexts for Alt.some and Alt.many do not give us access to Applicative f when we're defining Alt (Coyoneda f).

treeowl commented 8 years ago

I fixed some and many, and also saw an opportunity to kill one fmap each in <*> and <.>.