Check

ghc-8.2.2: The GHC API

Safe Haskell | None
Language | Haskell2010

Check

Synopsis

- checkSingle :: DynFlags -> DsMatchContext -> Id -> Pat Id -> DsM ()
- checkMatches :: DynFlags -> DsMatchContext -> [Id] -> [LMatch Id (LHsExpr Id)] -> DsM ()
- isAnyPmCheckEnabled :: DynFlags -> DsMatchContext -> Bool
- genCaseTmCs1 :: Maybe (LHsExpr Id) -> [Id] -> Bag SimpleEq
- genCaseTmCs2 :: Maybe (LHsExpr Id) -> [Pat Id] -> [Id] -> DsM (Bag SimpleEq)

# Documentation

checkSingle :: DynFlags -> DsMatchContext -> Id -> Pat Id -> DsM () Source #

Check a single pattern binding (let)

checkMatches :: DynFlags -> DsMatchContext -> [Id] -> [LMatch Id (LHsExpr Id)] -> DsM () Source #

Check a matchgroup (case, functions, etc.)

isAnyPmCheckEnabled :: DynFlags -> DsMatchContext -> Bool Source #

Check whether any part of pattern match checking is enabled (does not matter whether it is the redundancy check or the exhaustiveness check).

genCaseTmCs1 :: Maybe (LHsExpr Id) -> [Id] -> Bag SimpleEq Source #

Generate a simple equality when checking a case expression: case x of { matches } When checking matches we record that (x ~ y) where y is the initial uncovered. All matches will have to satisfy this equality.

genCaseTmCs2 :: Maybe (LHsExpr Id) -> [Pat Id] -> [Id] -> DsM (Bag SimpleEq) Source #

Generate equalities when checking a case expression: case x of { p1 -> e1; ... pn -> en } When we go deeper to check e.g. e1 we record two equalities: (x ~ y), where y is the initial uncovered when checking (p1; .. ; pn) and (x ~ p1).