# The GHC Commentary - Prelude Foundations

The standard Haskell Prelude as well as GHC's Prelude extensions are constructed from GHC's primitives in a couple of layers.

#### `PrelBase.lhs`

Some most elementary Prelude definitions are collected in `PrelBase.lhs`. In particular, it defines the boxed versions of Haskell primitive types - for example, `Int` is defined as

>     data Int = I# Int#

Saying that a boxed integer `Int` is formed by applying the data constructor `I#` to an unboxed integer of type `Int#`. Unboxed types are hardcoded in the compiler and exported together with the primitive operations understood by GHC.

`PrelBase.lhs` similarly defines basic types, such as, boolean values

>     data  Bool  =  False | True  deriving (Eq, Ord)

the unit type

>     data  ()  =  ()

and lists

>     data [] a = [] | a : [a]

It also contains instance delarations for these types. In addition, `PrelBase.lhs` contains some tricky machinery for efficient list handling.

Last modified: Wed Aug 8 19:30:18 EST 2001