ghc-8.0.0.20160204: The GHC API

Safe HaskellNone
LanguageHaskell2010

DsUtils

Description

Utility functions for constructing Core syntax, principally for desugaring

Synopsis

Documentation

data CanItFail Source

Constructors

CanFail 
CantFail 

data CaseAlt a Source

Constructors

MkCaseAlt 

mkSelectorBinds Source

Arguments

:: Bool

is strict

-> [[Tickish Id]]

ticks to add, possibly

-> LPat Id

The pattern

-> CoreExpr

Expression to which the pattern is bound

-> DsM (Maybe 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

getUnBangedLPat Source

Arguments

:: DynFlags 
-> LPat id

Original pattern

-> (Bool, LPat id) 

Remove any bang from a pattern and say if it is a strict bind, also make irrefutable patterns ordinary patterns if -XStrict.

Example: ~pat => False, pat -- when -XStrict ~pat => False, ~pat -- without -XStrict ~(~pat) => False, ~pat -- when -XStrict pat => True, pat -- when -XStrict !pat => True, pat -- always