X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FdeSugar%2FDsMonad.lhs;h=cbe182e44ea23fafb675787cd7467a2109d46414;hb=ab22f4e6456820c1b5169d75f5975a94e61f54ce;hp=acdecfee37a7566d0a19fc2e8213371fc956baa2;hpb=7a59afcebe45ea87c42006873f77eb4600d7316f;p=ghc-hetmet.git diff --git a/compiler/deSugar/DsMonad.lhs b/compiler/deSugar/DsMonad.lhs index acdecfe..cbe182e 100644 --- a/compiler/deSugar/DsMonad.lhs +++ b/compiler/deSugar/DsMonad.lhs @@ -1,7 +1,9 @@ % +% (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 ( @@ -26,36 +28,35 @@ 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} @@ -73,12 +74,11 @@ data DsMatchContext deriving () data EquationInfo - = EqnInfo { eqn_wrap :: DsWrapper, -- Bindings - eqn_pats :: [Pat Id], -- The patterns for an eqn + = EqnInfo { eqn_pats :: [Pat Id], -- The patterns for an eqn 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 })