projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fdaede6
)
Make a Functor (IOEnv m) instance so it satisfies the new Quasi requirements
author
Ian Lynagh
<igloo@earth.li>
Thu, 22 Mar 2007 17:01:14 +0000
(17:01 +0000)
committer
Ian Lynagh
<igloo@earth.li>
Thu, 22 Mar 2007 17:01:14 +0000
(17:01 +0000)
compiler/utils/IOEnv.hs
patch
|
blob
|
history
diff --git
a/compiler/utils/IOEnv.hs
b/compiler/utils/IOEnv.hs
index
c0277ae
..
c72347e
100644
(file)
--- a/
compiler/utils/IOEnv.hs
+++ b/
compiler/utils/IOEnv.hs
@@
-47,6
+47,9
@@
instance Monad (IOEnv m) where
return = returnM
fail s = failM -- Ignore the string
+instance Functor (IOEnv m) where
+ fmap f (IOEnv m) = IOEnv (\ env -> fmap f (m env))
+
returnM :: a -> IOEnv env a
returnM a = IOEnv (\ env -> return a)