All Monads are Functors

Taral taralx at gmail.com
Wed Aug 16 02:56:48 EDT 2006


On 8/16/06, Bulat Ziganshin <bulat.ziganshin at gmail.com> wrote:
> you deleted context of my note, where you wrote something opposite to
> "All Monads are Functors":
>
> > Not necessarily. If A doesn't have any Functor declarations, it could
> > be considered just a Monad without a Functor.
>
> is it possible to declare Monad Foo without Functor Foo with the above
> class definition?

You misunderstood what I meant. "Monad without a Functor" means Monad
*declaration* without an explicit Functor *declaration*, i.e. using
the defaults. The problem happens when a definition implicitly uses
the defaults and then an explicit Functor comes into scope via import.

The current proposal to require people to write "instance Functor"
isn't so pretty as the hierarchy becomes more fine-grained:

instance Monad [] where
    instance Functor
    instance PointedFunctor
    instance Applicative
    ...

-- 
Taral <taralx at gmail.com>
"You can't prove anything."
    -- Gödel's Incompetence Theorem


More information about the Haskell-prime mailing list