Applicative and Functor

Ross Paterson ross at soi.city.ac.uk
Sat Mar 4 04:55:43 EST 2006


On Fri, Mar 03, 2006 at 07:14:16PM -0800, Ashley Yakeley wrote:
> Shouldn't Applicative be a subclass of Functor? "<$>" can then be dropped.
> [The Functor laws are implied by the Applicative laws]

It's the same old problem as with Monad, Functor and liftM (or indeed
with Monad, Applicative and return): that fine-grained hierarchies in
Haskell mean extra work for the programmer.  You'd be forced to define a
Functor instance, even if all you wanted was pure and <*>.  There have
been a series of proposed language changes to address this, the latest
being John Meacham's class synonyms.  But less connected classes seem
to fit better with the current Haskell.



More information about the Libraries mailing list