@@ -30,10 +30,12 @@ instance applyData :: Apply Data where
30instance applicativeData :: Applicative Data where
30instance applicativeData :: Applicative Data where
31 pure = return
31 pure = return
33−instance monadData :: Prelude.Monad Data where
33+instance bindData :: Bind Data where
35 (>>=) (Data a) f = f a
34 (>>=) (Data a) f = f a
36+instance monadData :: Monad Data where
37data Maybe a = Nothing | Just a
39data Maybe a = Nothing | Just a
39instance functorMaybe :: Functor Maybe where
41instance functorMaybe :: Functor Maybe where
@@ -45,11 +47,13 @@ instance applyMaybe :: Apply Maybe where
45instance applicativeMaybe :: Applicative Maybe where
47instance applicativeMaybe :: Applicative Maybe where
46 pure = return
48 pure = return
48−instance monadMaybe :: Prelude.Monad Maybe where
50+instance bindMaybe :: Bind Maybe where
50 (>>=) Nothing _ = Nothing
51 (>>=) Nothing _ = Nothing
51 (>>=) (Just a) f = f a
52 (>>=) (Just a) f = f a
54+instance monadMaybe :: Monad Maybe where
53test4 :: forall a m. (Monad m) => a -> m Number
57test4 :: forall a m. (Monad m) => a -> m Number
54test4 = \_ -> return 1
58test4 = \_ -> return 1
@@ -70,10 +74,12 @@ instance applyFunction :: Apply ((->) r) where
70instance applicativeFunction :: Applicative ((->) r) where
74instance applicativeFunction :: Applicative ((->) r) where
71 pure = return
75 pure = return
73−instance monadFunction :: Prelude.Monad ((->) r) where
77+instance bindFunction :: Bind ((->) r) where
75 (>>=) f g r = g (f r) r
78 (>>=) f g r = g (f r) r
80+instance monadFunction :: Monad ((->) r) where
79runReader r f = f r
85runReader r f = f r