MatchLit

ghc-8.10.3: The GHC API

Safe Haskell | None
Language | Haskell2010

MatchLit

Synopsis

- dsLit :: HsLit GhcRn -> DsM CoreExpr
- dsOverLit :: HsOverLit GhcTc -> DsM CoreExpr
- hsLitKey :: DynFlags -> HsLit GhcTc -> Literal
- tidyLitPat :: HsLit GhcTc -> Pat GhcTc
- tidyNPat :: HsOverLit GhcTc -> Maybe (SyntaxExpr GhcTc) -> SyntaxExpr GhcTc -> Type -> Pat GhcTc
- matchLiterals :: [Id] -> Type -> [[EquationInfo]] -> DsM MatchResult
- matchNPlusKPats :: [Id] -> Type -> [EquationInfo] -> DsM MatchResult
- matchNPats :: [Id] -> Type -> [EquationInfo] -> DsM MatchResult
- warnAboutIdentities :: DynFlags -> CoreExpr -> Type -> DsM ()
- warnAboutOverflowedOverLit :: HsOverLit GhcTc -> DsM ()
- warnAboutOverflowedLit :: HsLit GhcTc -> DsM ()
- warnAboutEmptyEnumerations :: DynFlags -> LHsExpr GhcTc -> Maybe (LHsExpr GhcTc) -> LHsExpr GhcTc -> DsM ()

# Documentation

dsLit :: HsLit GhcRn -> DsM CoreExpr Source #

dsOverLit :: HsOverLit GhcTc -> DsM CoreExpr Source #

Post-typechecker, the `HsExpr` field of an `OverLit` contains (an expression for) the literal value itself.

hsLitKey :: DynFlags -> HsLit GhcTc -> Literal Source #

tidyLitPat :: HsLit GhcTc -> Pat GhcTc Source #

tidyNPat :: HsOverLit GhcTc -> Maybe (SyntaxExpr GhcTc) -> SyntaxExpr GhcTc -> Type -> Pat GhcTc Source #

matchLiterals :: [Id] -> Type -> [[EquationInfo]] -> DsM MatchResult Source #

matchNPlusKPats :: [Id] -> Type -> [EquationInfo] -> DsM MatchResult Source #

matchNPats :: [Id] -> Type -> [EquationInfo] -> DsM MatchResult Source #

warnAboutIdentities :: DynFlags -> CoreExpr -> Type -> DsM () Source #

warnAboutOverflowedOverLit :: HsOverLit GhcTc -> DsM () Source #

Emit warnings on overloaded integral literals which overflow the bounds implied by their type.

warnAboutOverflowedLit :: HsLit GhcTc -> DsM () Source #

Emit warnings on integral literals which overflow the boudns implied by their type.

warnAboutEmptyEnumerations :: DynFlags -> LHsExpr GhcTc -> Maybe (LHsExpr GhcTc) -> LHsExpr GhcTc -> DsM () Source #

Warns about `[2,3 .. 1]` which returns the empty list. Only works for integral types, not floating point.