[project @ 2005-03-01 05:49:43 by simonpj]
[ghc-hetmet.git] / ghc / compiler / deSugar / DsMonad.lhs
index 8fecc81..b82a30a 100644 (file)
@@ -25,7 +25,7 @@ module DsMonad (
 
        -- Data types
        DsMatchContext(..),
-       EquationInfo(..), MatchResult(..), 
+       EquationInfo(..), MatchResult(..), DsWrapper, idWrapper,
        CanItFail(..), orFail
     ) where
 
@@ -74,9 +74,13 @@ data DsMatchContext
   deriving ()
 
 data EquationInfo
-  = EqnInfo { eqn_pats :: [Pat Id],            -- The patterns for an eqn
+  = EqnInfo { eqn_wrap :: DsWrapper,   -- Bindings
+             eqn_pats :: [Pat Id],     -- The patterns for an eqn
              eqn_rhs  :: MatchResult } -- What to do after match
 
+type DsWrapper = CoreExpr -> CoreExpr
+idWrapper e = e
+
 -- The semantics of (match vs (EqnInfo wrap pats rhs)) is the MatchResult
 --     \fail. wrap (case vs of { pats -> rhs fail })
 -- where vs are not in the domain of wrap