--- /Generics
-
-data OutPat id
- = WildPat Type -- wild card
- | VarPat id -- variable (type is in the Id)
- | LazyPat (OutPat id) -- lazy pattern
- | 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]
- | PArrPat -- Syntactic parallel array
- Type -- The type of the elements
- [OutPat id]
-
- | TuplePat [OutPat id] -- Tuple
- Boxity
- -- UnitPat is TuplePat []
-
- | ConPat DataCon
- Type -- the type of the pattern
- [TyVar] -- Existentially bound type variables
- [id] -- Ditto dictionaries
- [OutPat id]
-
- -- ConOpPats are only used on the input side
-
- | RecPat DataCon -- Record constructor
- Type -- The type of the pattern
- [TyVar] -- Existentially bound type variables
- [id] -- Ditto dictionaries
- [(Id, OutPat id, Bool)] -- True <=> source used punning
-
- | LitPat -- Used for *non-overloaded* literal patterns:
- -- Int#, Char#, Int, Char, String, etc.
- HsLit
- Type -- Type of pattern
-
- | NPat -- Used for literal patterns where there's an equality function to call
- HsLit -- The literal is retained so that
- -- the desugarer can readily identify
- -- equations with identical literal-patterns
- -- Always HsInteger, HsRat or HsString.
- -- *Unlike* NPatIn, for negative literals, the
- -- literal is acutally negative!
- Type -- Type of pattern, t
- (HsExpr id (OutPat id)) -- Of type t -> Bool; detects match
-
- | NPlusKPat id
- Integer
- Type -- Type of pattern, t
- (HsExpr id (OutPat id)) -- Of type t -> Bool; detects match
- (HsExpr id (OutPat id)) -- Of type t -> t; subtracts k