Skip to content

GHC.TypeLits module Haddocks contradict the GHC manual

The Haddocks of GHC.TypeLits state:

This module is an internal GHC module. It declares the constants used in the implementation of type-level natural numbers. The programmer interface for working with type-level naturals should be defined in a separate library.

In contradiction, the Type-Level Literals section of the GHC user's guide recommends importing this module.

Here is an example of using type-level numeric literals to provide a safe interface to a low-level function:

import GHC.TypeLits

If it is the Haddocks that are correct, then I suspect that their lack of mention of what the separate library is (I have not found it) is an accidental omission.

I believe the Haddocks contain an additional error (which is ancillary to the main issue here): It states that the module is for "type-level naturals", which seems misleading because the module exports things related to both type-level naturals (the Nat kind) and also type-level strings (the Symbol kind) in roughly equal proportion.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information