Chapter 8. The GHC prelude and libraries

Table of Contents
8.1. Prelude extensions
8.2. GHC-only Extension Libraries
8.3. The module PrelGHC: really primitive stuff

This document describes GHC's prelude and libraries. The basic story is that of the Haskell 1.4 Report and Libraries document (which we do not reproduce here), but this document describes in addition:

A number of the libraries that provide access to GHC's language extensions are shared by Hugs, and are described in the GHC/Hugs Extension Libraries document.

8.1. Prelude extensions

GHC's prelude contains the following non-standard extensions:

fromInt method in class Num:

It's there. Converts from an Int to the type.

toInt method in class Integral:

Converts from Integral type to an Int.

GHC also internally uses a number of modules that begin with the string Prel: for this reason, we don't recommend that you use any module names beginning with Prel in your own programs. The Prel modules are always available: in fact, you can get access to several extensions this way (for some you might need to give the -fglasgow-exts flag).