Add {-# OPTIONS_GHC -w #-} and some blurb to all compiler modules
[ghc-hetmet.git] / compiler / utils / IOEnv.hs
index c0277ae..d31b078 100644 (file)
@@ -4,6 +4,13 @@
 -- The IO Monad with an environment
 --
 
+{-# OPTIONS_GHC -w #-}
+-- The above warning supression flag is a temporary kludge.
+-- While working on this module you are encouraged to remove it and fix
+-- any warnings in the module. See
+--     http://hackage.haskell.org/trac/ghc/wiki/WorkingConventions#Warnings
+-- for details
+
 module IOEnv (
        IOEnv,  -- Instance of Monad
 
@@ -47,6 +54,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)