On Mon, Oct 05, 2009 at 07:24:00AM -0700, Michael Mossey wrote:
> If I understand correctly, this works because IO is an instance of
> Applicative, correct?
>
> I wonder if any of the random monads are instances of Applicative.

If they aren't then that's a bug in the library :).  Every monad
can be made an instance of Applicative; given any monad M,

instance Functor M where
  fmap = liftM -- from Control.Monad

instance Applicative M where
  pure  = return
  (<*>) = ap -- from Control.Applicative

--
Felipe.
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to