[project @ 2001-11-26 09:20:25 by simonpj]
[ghc-hetmet.git] / ghc / compiler / hsSyn / HsPat.lhs
index c5fa2c7..00df779 100644 (file)
@@ -9,8 +9,8 @@ module HsPat (
        OutPat(..),
 
        irrefutablePat, irrefutablePats,
-       failureFreePat, isWildPat,
-       patsAreAllCons, isConPat,
+       failureFreePat, isWildPat, 
+       patsAreAllCons, isConPat, 
        patsAreAllLits, isLitPat,
        collectPatBinders, collectPatsBinders,
        collectSigTysFromPat, collectSigTysFromPats
@@ -87,6 +87,12 @@ data OutPat id
   | AsPat          id          -- as pattern
                    (OutPat id)
 
+  | SigPat         (OutPat id) -- Pattern p
+                   Type        -- Type, t, of the whole pattern
+                   (HsExpr id (OutPat id))
+                               -- Coercion function,
+                               -- of type t -> typeof(p)
+
   | ListPat                    -- Syntactic list
                    Type        -- The type of the elements
                    [OutPat id]
@@ -187,6 +193,8 @@ pprOutPat (LazyPat pat)     = hcat [char '~', ppr pat]
 pprOutPat (AsPat name pat)
   = parens (hcat [ppr name, char '@', ppr pat])
 
+pprOutPat (SigPat pat ty _)   = ppr pat <+> dcolon <+> ppr ty
+
 pprOutPat (ConPat name ty [] [] [])
   = ppr name