@@ -124,23 +124,17 @@ instance Alternative List where
124---- Monad instances
124---- Monad instances
126instance Monad IO where
126instance Monad IO where
127− return t = io_return t
128 b >>= k = io_bind b k
127 b >>= k = io_bind b k
130instance Monad Maybe where
129instance Monad Maybe where
133 Nothing >>= k = Nothing
130 Nothing >>= k = Nothing
134 (Just x) >>= k = k x
131 (Just x) >>= k = k x
136instance Monad (Either e) where
133instance Monad (Either e) where
139 (Left n) >>= _ = Left n
134 (Left n) >>= _ = Left n
140 (Right r) >>= f = f r
135 (Right r) >>= f = f r
142instance Monad List where
137instance Monad List where
144 m >>= f = concatMap f m
138 m >>= f = concatMap f m
146---- some mathematical operations
140---- some mathematical operations