%
+% (c) The University of Glasgow 2006
% (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
%
-\section[DsMonad]{@DsMonad@: monadery used in desugaring}
+
+@DsMonad@: monadery used in desugaring
\begin{code}
module DsMonad (
-- Data types
DsMatchContext(..),
- EquationInfo(..), MatchResult(..), DsWrapper, idWrapper,
+ EquationInfo(..), MatchResult(..), DsWrapper, idDsWrapper,
CanItFail(..), orFail
) where
#include "HsVersions.h"
import TcRnMonad
-import CoreSyn ( CoreExpr )
-import HsSyn ( HsExpr, HsMatchContext, Pat )
-import TcIface ( tcIfaceGlobal )
-import RdrName ( GlobalRdrEnv )
-import HscTypes ( TyThing(..), TypeEnv, HscEnv(..),
- tyThingId, tyThingTyCon, tyThingDataCon, mkPrintUnqualified )
-import Bag ( emptyBag, snocBag )
-import DataCon ( DataCon )
-import TyCon ( TyCon )
-import Id ( mkSysLocal, setIdUnique, Id )
-import Module ( Module )
-import Var ( TyVar, setTyVarUnique )
+import CoreSyn
+import HsSyn
+import TcIface
+import RdrName
+import HscTypes
+import Bag
+import DataCon
+import TyCon
+import Id
+import Module
+import Var
import Outputable
-import SrcLoc ( noSrcSpan, SrcSpan )
-import Type ( Type )
-import UniqSupply ( UniqSupply, uniqsFromSupply )
-import Name ( Name, nameOccName )
+import SrcLoc
+import Type
+import UniqSupply
+import Name
import NameEnv
-import OccName ( occNameFS )
-import DynFlags ( DynFlags )
-import ErrUtils ( Messages, mkWarnMsg, mkErrMsg,
- printErrorsAndWarnings, errorsFound )
-import DATA_IOREF ( newIORef, readIORef )
+import OccName
+import DynFlags
+import ErrUtils
+
+import Data.IORef
infixr 9 `thenDs`
\end{code}
eqn_rhs :: MatchResult } -- What to do after match
type DsWrapper = CoreExpr -> CoreExpr
-idWrapper e = e
+idDsWrapper e = e
-- The semantics of (match vs (EqnInfo wrap pats rhs)) is the MatchResult
-- \fail. wrap (case vs of { pats -> rhs fail })