From 97ff1011ef0abd03e132d9b8025f5aaf0c53b6c7 Mon Sep 17 00:00:00 2001 From: Brian Victor Date: Thu, 23 Aug 2012 14:37:10 -0400 Subject: [PATCH] Added NoImplicitPrelude directive, made type signatures more restrictive to match how the monad functions are implemented in Fay. --- test.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test.hs b/test.hs index 9bb1fe0..e5d628a 100644 --- a/test.hs +++ b/test.hs @@ -1,16 +1,18 @@ +{-# LANGUAGE NoImplicitPrelude #-} + module Test (main) where -import Language.Fay.Prelude hiding (return, ($), (.), (>>=), (++), map, foldr, find) +import Language.Fay.Prelude import Language.Fay.JQuery import Language.Fay.FFI -(>=>) :: Monad m => (a -> m b) -> (b -> m c) -> (a -> m c) +(>=>) :: (a -> Fay b) -> (b -> Fay c) -> (a -> Fay c) f >=> g = \x -> f x >>= g -myMapM :: Monad m => (a -> m b) -> [a] -> m [b] +myMapM :: (a -> Fay b) -> [a] -> Fay [b] myMapM f as = mySequence (map f as) -mySequence :: Monad m => [m a] -> m [a] +mySequence :: [Fay a] -> Fay [a] mySequence ms = let k m m' = do { x <- m; xs <- m'; return (x:xs) } in foldr k (return []) ms