ghc-8.8.0.20190613: The GHC API
Safe HaskellNone
LanguageHaskell2010

DsUtils

Description

Utility functions for constructing Core syntax, principally for desugaring

Synopsis

Documentation

data EquationInfo Source #

Constructors

EqnInfo 

Fields

  • eqn_pats :: [Pat GhcTc]

    The patterns for an equation

    NB: We have already applied decideBangHood to these patterns. See Note [decideBangHood] in DsUtils

  • eqn_orig :: Origin

    Was this equation present in the user source?

    This helps us avoid warnings on patterns that GHC elaborated.

    For instance, the pattern -1 :: Word gets desugared into W# :: Word, but we shouldn't warn about an overflowed literal for both of these cases.

  • eqn_rhs :: MatchResult

    What to do after match

Instances

Instances details
Outputable EquationInfo # 
Instance details

Defined in DsMonad

data CanItFail Source #

Constructors

CanFail 
CantFail 

data CaseAlt a Source #

Constructors

MkCaseAlt 

mkSelectorBinds Source #

Arguments

:: [[Tickish Id]]

ticks to add, possibly

-> LPat GhcTc

The pattern

-> CoreExpr

Expression to which the pattern is bound

-> DsM (Id, [(Id, CoreExpr)])

Id the rhs is bound to, for desugaring strict binds (see Note [Desugar Strict binds] in DsBinds) and all the desugared binds

decideBangHood Source #

Arguments

:: DynFlags 
-> LPat GhcTc

Original pattern

-> LPat GhcTc 

Use -XStrict to add a ! or remove a ~ See Note [decideBangHood]

addBang Source #

Arguments

:: LPat GhcTc

Original pattern

-> LPat GhcTc

Banged pattern

Unconditionally make a Pat strict.