@@ -60,8 +60,8 @@ module Prelude where
6060 pure :: forall a. a -> f a
6161 (<*>) :: forall a b. f (a -> b) -> f a -> f b
6262
63− instance functorFromApplicative :: (Applicative f) => Functor f where
64− (<$>) f a = pure f <*> a
63+ liftA1 :: forall f a b. (Applicative f) => (a -> b) -> f a -> f b
64+ liftA1 f a = pure f <*> a
6565
6666 infixl 3 <|>
6767
@@ -75,12 +75,11 @@ module Prelude where
7575 return :: forall a. a -> m a
7676 (>>=) :: forall a b. m a -> (a -> m b) -> m b
7777
78− instance applicativeFromMonad :: (Monad m) => Applicative m where
79− pure = return
80− (<*>) f a = do
81− f' <- f
82− a' <- a
83− return (f' a')
78+ ap :: forall m a b. (Monad m) => m (a -> b) -> m a -> m b
79+ ap f a = do
80+ f' <- f
81+ a' <- a
82+ return (f' a')
8483
8584 infixl 7 *
8685 infixl 7 /
@@ -368,6 +367,13 @@ module Control.Monad.Eff where
368367 \ return f();\
369368 \}" :: forall a. Pure a -> a
370369
370+ instance functorEff :: Functor (Eff e) where
371+ (<$>) = liftA1
372+
373+ instance applicativeEff :: Applicative (Eff e) where
374+ pure = return
375+ (<*>) = ap
376+
371377 instance monadEff :: Monad (Eff e) where
372378 return = retEff
373379 (>>=) = bindEff