On Sat, Oct 31, 2009 at 8:38 AM, David Menendez <dave@zednenem.com> wrote:
On Sat, Oct 31, 2009 at 6:22 AM, Heinrich ApfelmusThis is inconsistent with the Applicative instance given above.
<apfelmus@quantentunnel.de> wrote:
> The only possible monad instance would be
>
> return x = Const mempty
> fmap f (Const b) = Const b
> join (Const b) = Const b
>
> but that's not just () turned into a monad.
Const a <*> Const b = Const (a `mappend` b)
Const a `ap` Const b = Const a
In other words, Const has at least two Applicative instances, one of
which is not also a monad.