ghc-7.0.3: The GHC API

BasicTypes

Synopsis

- type Version = Int
- bumpVersion :: Version -> Version
- initialVersion :: Version
- type Arity = Int
- data FunctionOrData
  - = IsFunction
  - | IsData
- data WarningTxt
  - = WarningTxt [FastString]
  - | DeprecatedTxt [FastString]
- data Fixity = Fixity Int FixityDirection
- data FixityDirection
  - = InfixL
  - | InfixR
  - | InfixN
- defaultFixity :: Fixity
- maxPrecedence :: Int
- negateFixity :: Fixity
- funTyFixity :: Fixity
- compareFixity :: Fixity -> Fixity -> (Bool, Bool)
- newtype IPName name = IPName name
- ipNameName :: IPName name -> name
- mapIPName :: (a -> b) -> IPName a -> IPName b
- data RecFlag
  - = Recursive
  - | NonRecursive
- isRec :: RecFlag -> Bool
- isNonRec :: RecFlag -> Bool
- boolToRecFlag :: Bool -> RecFlag
- type RuleName = FastString
- data TopLevelFlag
  - = TopLevel
  - | NotTopLevel
- isTopLevel :: TopLevelFlag -> Bool
- isNotTopLevel :: TopLevelFlag -> Bool
- data OverlapFlag
  - = NoOverlap
  - | OverlapOk
  - | Incoherent
- data Boxity
  - = Boxed
  - | Unboxed
- isBoxed :: Boxity -> Bool
- data TupCon = TupCon Boxity Arity
- tupleParens :: Boxity -> SDoc -> SDoc
- data OccInfo
  - = NoOccInfo
  - | IAmDead
  - | OneOcc !InsideLam !OneBranch !InterestingCxt
  - | IAmALoopBreaker !RulesOnly
- seqOccInfo :: OccInfo -> ()
- zapFragileOcc :: OccInfo -> OccInfo
- isOneOcc :: OccInfo -> Bool
- isDeadOcc :: OccInfo -> Bool
- isLoopBreaker :: OccInfo -> Bool
- isNonRuleLoopBreaker :: OccInfo -> Bool
- isNoOcc :: OccInfo -> Bool
- nonRuleLoopBreaker :: OccInfo
- type InsideLam = Bool
- insideLam :: InsideLam
- notInsideLam :: InsideLam
- type OneBranch = Bool
- oneBranch :: OneBranch
- notOneBranch :: OneBranch
- type InterestingCxt = Bool
- data EP a = EP {
  - fromEP :: a
  - toEP :: a
  }
- data HsBang
  - = HsNoBang
  - | HsStrict
  - | HsUnpack
  - | HsUnpackFailed
- isBanged :: HsBang -> Bool
- isMarkedUnboxed :: HsBang -> Bool
- data StrictnessMark
  - = MarkedStrict
  - | NotMarkedStrict
- isMarkedStrict :: StrictnessMark -> Bool
- data DefMethSpec
  - = NoDM
  - | VanillaDM
  - | GenericDM
- data CompilerPhase
  - = Phase PhaseNum
  - | InitialPhase
- type PhaseNum = Int
- data Activation
  - = NeverActive
  - | AlwaysActive
  - | ActiveBefore PhaseNum
  - | ActiveAfter PhaseNum
- isActive :: CompilerPhase -> Activation -> Bool
- isActiveIn :: PhaseNum -> Activation -> Bool
- isNeverActive :: Activation -> Bool
- isAlwaysActive :: Activation -> Bool
- isEarlyActive :: Activation -> Bool
- data RuleMatchInfo
  - = ConLike
  - | FunLike
- isConLike :: RuleMatchInfo -> Bool
- isFunLike :: RuleMatchInfo -> Bool
- data InlineSpec
  - = Inline
  - | Inlinable
  - | NoInline
  - | EmptyInlineSpec
- data InlinePragma = InlinePragma {
  - inl_inline :: InlineSpec
  - inl_sat :: Maybe Arity
  - inl_act :: Activation
  - inl_rule :: RuleMatchInfo
  }
- defaultInlinePragma :: InlinePragma
- alwaysInlinePragma :: InlinePragma
- neverInlinePragma :: InlinePragma
- dfunInlinePragma :: InlinePragma
- isDefaultInlinePragma :: InlinePragma -> Bool
- isInlinePragma :: InlinePragma -> Bool
- isInlinablePragma :: InlinePragma -> Bool
- isAnyInlinePragma :: InlinePragma -> Bool
- inlinePragmaSpec :: InlinePragma -> InlineSpec
- inlinePragmaSat :: InlinePragma -> Maybe Arity
- inlinePragmaActivation :: InlinePragma -> Activation
- inlinePragmaRuleMatchInfo :: InlinePragma -> RuleMatchInfo
- setInlinePragmaActivation :: InlinePragma -> Activation -> InlinePragma
- setInlinePragmaRuleMatchInfo :: InlinePragma -> RuleMatchInfo -> InlinePragma
- data SuccessFlag
  - = Succeeded
  - | Failed
- succeeded :: SuccessFlag -> Bool
- failed :: SuccessFlag -> Bool
- successIf :: Bool -> SuccessFlag

# Documentation

type Version = Int Source

bumpVersion :: Version -> Version Source

initialVersion :: Version Source

type Arity = Int Source

data FunctionOrData Source

Constructors

IsFunction |
IsData |

Instances

Eq FunctionOrData |
Data FunctionOrData |
Ord FunctionOrData |
Typeable FunctionOrData |
Outputable FunctionOrData |
Binary FunctionOrData |

data WarningTxt Source

Constructors

WarningTxt [FastString] |
DeprecatedTxt [FastString] |

Instances

Eq WarningTxt |
Data WarningTxt |
Typeable WarningTxt |
Outputable WarningTxt |
Binary WarningTxt |

data Fixity Source

Constructors

Fixity Int FixityDirection |

Instances

Eq Fixity |
Data Fixity |
Typeable Fixity |
Outputable Fixity |
Binary Fixity |

data FixityDirection Source

Constructors

InfixL |
InfixR |
InfixN |

Instances

Eq FixityDirection |
Data FixityDirection |
Typeable FixityDirection |
Outputable FixityDirection |
Binary FixityDirection |

defaultFixity :: Fixity Source

maxPrecedence :: Int Source

negateFixity :: Fixity Source

funTyFixity :: Fixity Source

compareFixity :: Fixity -> Fixity -> (Bool, Bool)Source

newtype IPName name Source

Constructors

IPName name |

Instances

Typeable1 IPName |
Eq name => Eq (IPName name) |
Data name => Data (IPName name) |
Ord name => Ord (IPName name) |
Outputable name => OutputableBndr (IPName name) |
Outputable name => Outputable (IPName name) |
Binary name => Binary (IPName name) |

ipNameName :: IPName name -> nameSource

mapIPName :: (a -> b) -> IPName a -> IPName bSource

data RecFlag Source

Constructors

Recursive |
NonRecursive |

Instances

Eq RecFlag |
Data RecFlag |
Typeable RecFlag |
Outputable RecFlag |
Binary RecFlag |

isRec :: RecFlag -> Bool Source

isNonRec :: RecFlag -> Bool Source

boolToRecFlag :: Bool -> RecFlag Source

type RuleName = FastString Source

data TopLevelFlag Source

Constructors

TopLevel |
NotTopLevel |

Instances

Outputable TopLevelFlag |

isTopLevel :: TopLevelFlag -> Bool Source

isNotTopLevel :: TopLevelFlag -> Bool Source

data OverlapFlag Source

Constructors

NoOverlap |
OverlapOk |
Incoherent |

Instances

Eq OverlapFlag |
Outputable OverlapFlag |
Binary OverlapFlag |

data Boxity Source

Constructors

Boxed |
Unboxed |

Instances

Eq Boxity |
Data Boxity |
Typeable Boxity |
Binary Boxity |

isBoxed :: Boxity -> Bool Source

data TupCon Source

Constructors

TupCon Boxity Arity |

Instances

Eq TupCon |
Binary TupCon |

tupleParens :: Boxity -> SDoc -> SDoc Source

data OccInfo Source

Identifier occurrence information

Constructors

NoOccInfo | There are many occurrences, or unknown occurences
IAmDead | Marks unused variables. Sometimes useful for lambda and case-bound variables.
OneOcc !InsideLam !OneBranch !InterestingCxt | Occurs exactly once, not inside a rule
IAmALoopBreaker !RulesOnly | This identifier breaks a loop of mutually recursive functions. The field marks whether it is only a loop breaker due to a reference in a rule

Instances

Show OccInfo |
Outputable OccInfo |

seqOccInfo :: OccInfo -> ()Source

zapFragileOcc :: OccInfo -> OccInfo Source

isOneOcc :: OccInfo -> Bool Source

isDeadOcc :: OccInfo -> Bool Source

isLoopBreaker :: OccInfo -> Bool Source

isNonRuleLoopBreaker :: OccInfo -> Bool Source

isNoOcc :: OccInfo -> Bool Source

nonRuleLoopBreaker :: OccInfo Source

type InsideLam = Bool Source

insideLam :: InsideLam Source

notInsideLam :: InsideLam Source

type OneBranch = Bool Source

oneBranch :: OneBranch Source

notOneBranch :: OneBranch Source

type InterestingCxt = Bool Source

data EP a Source

Constructors

EP |

Fields

fromEP :: a
toEP :: a

data HsBang Source

Constructors

HsNoBang |
HsStrict |
HsUnpack |
HsUnpackFailed |

Instances

Eq HsBang |
Data HsBang |
Typeable HsBang |
Outputable HsBang |
Binary HsBang |

isBanged :: HsBang -> Bool Source

isMarkedUnboxed :: HsBang -> Bool Source

data StrictnessMark Source

Constructors

MarkedStrict |
NotMarkedStrict |

Instances

Outputable StrictnessMark |

isMarkedStrict :: StrictnessMark -> Bool Source

data DefMethSpec Source

Constructors

NoDM |
VanillaDM |
GenericDM |

Instances

Outputable DefMethSpec |
Binary DefMethSpec |

data CompilerPhase Source

Constructors

Phase PhaseNum |
InitialPhase |

Instances

Outputable CompilerPhase |

type PhaseNum = Int Source

data Activation Source

Constructors

NeverActive |
AlwaysActive |
ActiveBefore PhaseNum |
ActiveAfter PhaseNum |

Instances

Eq Activation |
Data Activation |
Typeable Activation |
Outputable Activation |
Binary Activation |

isActive :: CompilerPhase -> Activation -> Bool Source

isActiveIn :: PhaseNum -> Activation -> Bool Source

isNeverActive :: Activation -> Bool Source

isAlwaysActive :: Activation -> Bool Source

isEarlyActive :: Activation -> Bool Source

data RuleMatchInfo Source

Constructors

ConLike |
FunLike |

Instances

Eq RuleMatchInfo |
Data RuleMatchInfo |
Show RuleMatchInfo |
Typeable RuleMatchInfo |
Outputable RuleMatchInfo |
Binary RuleMatchInfo |

isConLike :: RuleMatchInfo -> Bool Source

isFunLike :: RuleMatchInfo -> Bool Source

data InlineSpec Source

Constructors

Inline |
Inlinable |
NoInline |
EmptyInlineSpec |

Instances

Eq InlineSpec |
Data InlineSpec |
Show InlineSpec |
Typeable InlineSpec |
Outputable InlineSpec |
Binary InlineSpec |

data InlinePragma Source

Constructors

InlinePragma |

Fields

inl_inline :: InlineSpec
inl_sat :: Maybe Arity
inl_act :: Activation
inl_rule :: RuleMatchInfo

Instances

Eq InlinePragma |
Data InlinePragma |
Typeable InlinePragma |
Outputable InlinePragma |
Binary InlinePragma |

defaultInlinePragma :: InlinePragma Source

alwaysInlinePragma :: InlinePragma Source

neverInlinePragma :: InlinePragma Source

dfunInlinePragma :: InlinePragma Source

isDefaultInlinePragma :: InlinePragma -> Bool Source

isInlinePragma :: InlinePragma -> Bool Source

isInlinablePragma :: InlinePragma -> Bool Source

isAnyInlinePragma :: InlinePragma -> Bool Source

inlinePragmaSpec :: InlinePragma -> InlineSpec Source

inlinePragmaSat :: InlinePragma -> Maybe Arity Source

inlinePragmaActivation :: InlinePragma -> Activation Source

inlinePragmaRuleMatchInfo :: InlinePragma -> RuleMatchInfo Source

setInlinePragmaActivation :: InlinePragma -> Activation -> InlinePragma Source

setInlinePragmaRuleMatchInfo :: InlinePragma -> RuleMatchInfo -> InlinePragma Source

data SuccessFlag Source

Constructors

Succeeded |
Failed |

Instances

Outputable SuccessFlag |

succeeded :: SuccessFlag -> Bool Source

failed :: SuccessFlag -> Bool Source

successIf :: Bool -> SuccessFlag Source