Make a Functor (IOEnv m) instance so it satisfies the new Quasi requirements
authorIan Lynagh <igloo@earth.li>
Thu, 22 Mar 2007 17:01:14 +0000 (17:01 +0000)
committerIan Lynagh <igloo@earth.li>
Thu, 22 Mar 2007 17:01:14 +0000 (17:01 +0000)
compiler/utils/IOEnv.hs

index c0277ae..c72347e 100644 (file)
@@ -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)