Commit 0537cb7e authored by Austin Seipp's avatar Austin Seipp
Browse files

Another AMP fix for Stream


Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
parent 10d36f3c
......@@ -11,6 +11,8 @@ module Stream (
collect, fromList,
Stream.map, Stream.mapM, Stream.mapAccumL
) where
import Control.Monad
import Control.Applicative
-- |
-- @Stream m a b@ is a computation in some Monad @m@ that delivers a sequence
......@@ -37,6 +39,13 @@ module Stream (
--
newtype Stream m a b = Stream { runStream :: m (Either b (a, Stream m a b)) }
instance Monad f => Functor (Stream f a) where
fmap = liftM
instance Monad m => Applicative (Stream m a) where
pure = return
(<*>) = ap
instance Monad m => Monad (Stream m a) where
return a = Stream (return (Left a))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment