X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Futils%2FIOEnv.hs;h=728e55ca8d01f9f3cfe798391786db01e9627764;hb=8fd85c9d692f91a5b565bb0d54050c2ce6ac6ae2;hp=c0277ae851118ba14e3f2558ff69b553f1b57145;hpb=046ee54f048ddd721dcee41916d6a6f68db3b15b;p=ghc-hetmet.git diff --git a/compiler/utils/IOEnv.hs b/compiler/utils/IOEnv.hs index c0277ae..728e55c 100644 --- a/compiler/utils/IOEnv.hs +++ b/compiler/utils/IOEnv.hs @@ -1,3 +1,10 @@ +{-# OPTIONS -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/Commentary/CodingStyle#Warnings +-- for details + -- -- (c) The University of Glasgow 2002-2006 -- @@ -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)