BasicTypes

ghc-7.6.3: The GHC API

Safe Haskell | None

BasicTypes

Synopsis

- type Version = Int
- bumpVersion :: Version -> Version
- initialVersion :: Version
- type Arity = Int
- type RepArity = Int
- type Alignment = 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)
- 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 {
    - isSafeOverlap :: Bool
    }
  - | OverlapOk {
    - isSafeOverlap :: Bool
    }
  - | Incoherent {
    - isSafeOverlap :: Bool
    }
- data Boxity
  - = Boxed
  - | Unboxed
- isBoxed :: Boxity -> Bool
- data TupleSort
  - = BoxedTuple
  - | UnboxedTuple
  - | ConstraintTuple
- tupleSortBoxity :: TupleSort -> Boxity
- boxityNormalTupleSort :: Boxity -> TupleSort
- tupleParens :: TupleSort -> SDoc -> SDoc
- data OccInfo
  - = NoOccInfo
  - | IAmDead
  - | OneOcc !InsideLam !OneBranch !InterestingCxt
  - | IAmALoopBreaker !RulesOnly
- seqOccInfo :: OccInfo -> ()
- zapFragileOcc :: OccInfo -> OccInfo
- isOneOcc :: OccInfo -> Bool
- isDeadOcc :: OccInfo -> Bool
- isStrongLoopBreaker :: OccInfo -> Bool
- isWeakLoopBreaker :: OccInfo -> Bool
- isNoOcc :: OccInfo -> Bool
- strongLoopBreaker :: OccInfo
- weakLoopBreaker :: 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
  - | HsNoUnpack
- 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
- isEmptyInlineSpec :: InlineSpec -> Bool
- 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
- data FractionalLit = FL {
  - fl_text :: String
  - fl_value :: Rational
  }
- negateFractionalLit :: FractionalLit -> FractionalLit
- integralFractionalLit :: Integer -> FractionalLit

# Documentation

type Version = Int

bumpVersion :: Version -> Version

initialVersion :: Version

type Arity = Int

The number of value arguments that can be applied to a value before it does real work. So: fib 100 has arity 0 x -> fib x has arity 1

type RepArity = Int

The number of represented arguments that can be applied to a value before it does real work. So: fib 100 has representation arity 0 x -> fib x has representation arity 1 () -> fib (x + y) has representation arity 2

type Alignment = Int

data FunctionOrData

Constructors

IsFunction |
IsData |

Instances

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

data WarningTxt

Constructors

WarningTxt [FastString] |
DeprecatedTxt [FastString] |

Instances

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

data Fixity

Constructors

Fixity Int FixityDirection |

Instances

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

data FixityDirection

Constructors

InfixL |
InfixR |
InfixN |

Instances

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

defaultFixity :: Fixity

maxPrecedence :: Int

negateFixity :: Fixity

funTyFixity :: Fixity

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

data RecFlag

Constructors

Recursive |
NonRecursive |

Instances

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

isRec :: RecFlag -> Bool

isNonRec :: RecFlag -> Bool

boolToRecFlag :: Bool -> RecFlag

type RuleName = FastString

data TopLevelFlag

Constructors

TopLevel |
NotTopLevel |

Instances

Outputable TopLevelFlag |

isTopLevel :: TopLevelFlag -> Bool

isNotTopLevel :: TopLevelFlag -> Bool

data OverlapFlag

Constructors

NoOverlap | This instance must not overlap another
Fields isSafeOverlap :: Bool
OverlapOk | Silently ignore this instance if you find a more specific one that matches the constraint you are trying to resolve Example: constraint (Foo [Int]) instances (Foo [Int]) (Foo [a]) OverlapOk Since the second instance has the OverlapOk flag, the first instance will be chosen (otherwise its ambiguous which to choose)
Fields isSafeOverlap :: Bool
Incoherent | Like OverlapOk, but also ignore this instance if it doesn't match the constraint you are trying to resolve, but could match if the type variables in the constraint were instantiated Example: constraint (Foo [b]) instances (Foo [Int]) Incoherent (Foo [a]) Without the Incoherent flag, we'd complain that instantiating `b` would change which instance was chosen
Fields isSafeOverlap :: Bool

Instances

Eq OverlapFlag |
Data OverlapFlag |
Typeable OverlapFlag |
Outputable OverlapFlag |
Binary OverlapFlag |

data Boxity

Constructors

Boxed |
Unboxed |

Instances

Eq Boxity |
Data Boxity |
Typeable Boxity |

isBoxed :: Boxity -> Bool

data TupleSort

Constructors

BoxedTuple |
UnboxedTuple |
ConstraintTuple |

Instances

Eq TupleSort |
Data TupleSort |
Typeable TupleSort |
Binary TupleSort |

tupleSortBoxity :: TupleSort -> Boxity

boxityNormalTupleSort :: Boxity -> TupleSort

tupleParens :: TupleSort -> SDoc -> SDoc

data OccInfo

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

Outputable OccInfo |

seqOccInfo :: OccInfo -> ()

zapFragileOcc :: OccInfo -> OccInfo

isOneOcc :: OccInfo -> Bool

isDeadOcc :: OccInfo -> Bool

isStrongLoopBreaker :: OccInfo -> Bool

isWeakLoopBreaker :: OccInfo -> Bool

isNoOcc :: OccInfo -> Bool

strongLoopBreaker :: OccInfo

weakLoopBreaker :: OccInfo

type InsideLam = Bool

insideLam :: InsideLam

notInsideLam :: InsideLam

type OneBranch = Bool

oneBranch :: OneBranch

notOneBranch :: OneBranch

type InterestingCxt = Bool

data EP a

Constructors

EP |
Fields fromEP :: a toEP :: a

data HsBang

Constructors

HsNoBang |
HsStrict |
HsUnpack |
HsUnpackFailed |
HsNoUnpack |

Instances

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

isBanged :: HsBang -> Bool

isMarkedUnboxed :: HsBang -> Bool

data StrictnessMark

Constructors

MarkedStrict |
NotMarkedStrict |

Instances

Outputable StrictnessMark |

isMarkedStrict :: StrictnessMark -> Bool

data DefMethSpec

Constructors

NoDM |
VanillaDM |
GenericDM |

Instances

Outputable DefMethSpec |
Binary DefMethSpec |

data CompilerPhase

Constructors

Phase PhaseNum |
InitialPhase |

Instances

Outputable CompilerPhase |

type PhaseNum = Int

data Activation

Constructors

NeverActive |
AlwaysActive |
ActiveBefore PhaseNum |
ActiveAfter PhaseNum |

Instances

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

isActive :: CompilerPhase -> Activation -> Bool

isActiveIn :: PhaseNum -> Activation -> Bool

isNeverActive :: Activation -> Bool

isAlwaysActive :: Activation -> Bool

isEarlyActive :: Activation -> Bool

data RuleMatchInfo

Constructors

ConLike |
FunLike |

Instances

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

isConLike :: RuleMatchInfo -> Bool

isFunLike :: RuleMatchInfo -> Bool

data InlineSpec

Constructors

Inline |
Inlinable |
NoInline |
EmptyInlineSpec |

Instances

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

isEmptyInlineSpec :: InlineSpec -> Bool

data InlinePragma

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

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

Constructors

Succeeded |
Failed |

Instances

Outputable SuccessFlag |

succeeded :: SuccessFlag -> Bool

failed :: SuccessFlag -> Bool

successIf :: Bool -> SuccessFlag

data FractionalLit

Constructors

FL |
Fields fl_text :: String fl_value :: Rational

Instances

Eq FractionalLit |
Data FractionalLit |
Ord FractionalLit |
Show FractionalLit |
Typeable FractionalLit |
Outputable FractionalLit |

negateFractionalLit :: FractionalLit -> FractionalLit

integralFractionalLit :: Integer -> FractionalLit