Make compileToCore return the module name and type environment along with bindings
[ghc-hetmet.git] / compiler / utils / IOEnv.hs
index 30cc28b..fc513a0 100644 (file)
@@ -1,9 +1,3 @@
---
--- (c) The University of Glasgow 2002-2006
---
--- The IO Monad with an environment
---
-
 {-# OPTIONS -w #-}
 -- The above warning supression flag is a temporary kludge.
 -- While working on this module you are encouraged to remove it and fix
@@ -11,6 +5,12 @@
 --     http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings
 -- for details
 
+--
+-- (c) The University of Glasgow 2002-2006
+--
+-- The IO Monad with an environment
+--
+
 module IOEnv (
        IOEnv,  -- Instance of Monad
 
@@ -99,7 +99,9 @@ fixM f = IOEnv (\ env -> fixIO (\ r -> unIOEnv (f r) env))
 
 ---------------------------
 tryM :: IOEnv env r -> IOEnv env (Either Exception r)
--- Reflect UserError exceptions into IOEnv monad
+-- Reflect UserError exceptions (only) into IOEnv monad
+-- Other exceptions are not caught; they are simply propagated as exns
+--
 -- The idea is that errors in the program being compiled will give rise
 -- to UserErrors.  But, say, pattern-match failures in GHC itself should
 -- not be caught here, else they'll be reported as errors in the program