@@ -60,8 +60,8 @@ module Prelude where
60 pure :: forall a. a -> f a
60 pure :: forall a. a -> f a
61 (<*>) :: forall a b. f (a -> b) -> f a -> f b
61 (<*>) :: forall a b. f (a -> b) -> f a -> f b
63− instance functorFromApplicative :: (Applicative f) => Functor f where
63+ liftA1 :: forall f a b. (Applicative f) => (a -> b) -> f a -> f b
64− (<$>) f a = pure f <*> a
64+ liftA1 f a = pure f <*> a
66 infixl 3 <|>
66 infixl 3 <|>
@@ -75,12 +75,11 @@ module Prelude where
75 return :: forall a. a -> m a
75 return :: forall a. a -> m a
76 (>>=) :: forall a b. m a -> (a -> m b) -> m b
76 (>>=) :: forall a b. m a -> (a -> m b) -> m b
78− instance applicativeFromMonad :: (Monad m) => Applicative m where
78+ ap :: forall m a b. (Monad m) => m (a -> b) -> m a -> m b
80− (<*>) f a = do
79+ ap f a = do
83− return (f' a')
82+ return (f' a')
85 infixl 7 *
84 infixl 7 *
86 infixl 7 /
85 infixl 7 /
@@ -368,6 +367,13 @@ module Control.Monad.Eff where
368 \ return f();\
367 \ return f();\
369 \}" :: forall a. Pure a -> a
368 \}" :: forall a. Pure a -> a
370+ instance functorEff :: Functor (Eff e) where
373+ instance applicativeEff :: Applicative (Eff e) where
371 instance monadEff :: Monad (Eff e) where
377 instance monadEff :: Monad (Eff e) where
372 return = retEff
378 return = retEff
373 (>>=) = bindEff
379 (>>=) = bindEff