ghc-7.8.3: The GHC API

Safe HaskellNone
LanguageHaskell98

BasicTypes

Contents

Synopsis

Documentation

type ConTag = Int Source

Type of the tags associated with each constructor possibility

fIRST_TAG :: ConTag Source

Tags are allocated from here for real constructors

type Arity = Int Source

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 Source

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

data OverlapFlag Source

The semantics allowed for overlapping instances for a particular instance. See Note [Safe Haskell isSafeOverlap] (in lhs) for a explanation of the isSafeOverlap field.

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

Silently ignore this instance if you find any other that matches the constraing you are trying to resolve, including when checking if there are instances that do not match, but unify.

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. See also note [Incoherent instances]

Fields

isSafeOverlap :: Bool
 

data Boxity Source

Constructors

Boxed 
Unboxed 

The OneShotInfo type

data OneShotInfo Source

If the Id is a lambda-bound variable then it may have lambda-bound variable info. Sometimes we know whether the lambda binding this variable is a "one-shot" lambda; that is, whether it is applied at most once.

This information may be useful in optimisation, as computations may safely be floated inside such a lambda without risk of duplicating work.

Constructors

NoOneShotInfo

No information

ProbOneShot

The lambda is probably applied at most once

OneShotLam

The lambda is applied at most once.

noOneShotInfo :: OneShotInfo Source

It is always safe to assume that an Id has no lambda-bound variable information

data OccInfo Source

Identifier occurrence information

Constructors

NoOccInfo

There are many occurrences, or unknown occurrences

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

data EP a Source

Constructors

EP 

Fields

fromEP :: a
 
toEP :: a
 

data SwapFlag Source

Constructors

NotSwapped 
IsSwapped 

Instances

unSwap :: SwapFlag -> (a -> a -> b) -> a -> a -> b Source

newtype HValue Source

Constructors

HValue Any