HORIZON HASKELLDocslts/ghc-10.0.x04404a62026-10-19Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 04404a6 · 2026-10-19

Moduleghc-10.0.0.20260917GHC2024

GHC.Builtin.Types

This module is about types that can be defined in Haskell, but which must be wired into the compiler nonetheless. C.f module GHC.Builtin.Types.Prim

Contents
  1. Helper functions defined here
  2. All wired in things
  3. Bool
  4. Ordering
  5. Boxing primitive types
  6. Char
  7. Double
  8. Float
  9. Int
  10. Word
  11. Word8
  12. List
  13. Maybe
  14. Tuples
  15. Constraint tuples
  16. Any
  17. Recovery TyCon
  18. Sums
  19. Kinds
  20. Equality predicates
  21. RuntimeRep and friends
  22. Levity
  23. Multiplicity and friends
  24. Bignum
Synopsis

Helper functions defined here

All wired in things

Check if the OccName is an occurrence of built-in syntax.

This is a variant of isBuiltInOcc_maybe that returns a Bool. See Note [isBuiltInOcc_maybe]

isBuiltInOcc holds for: * function arrow -> * list syntax `[]`, : * boxed tuple syntax (), (,), (,,), (,,,), ... * unboxed tuple syntax (##), `()`, `()`, ... * unboxed sum type syntax (#|#), (#||#), (#|||#), ... * unboxed sum data syntax `()`, `()`, `(), ...

Bool

Ordering

Boxing primitive types

Given a type ty, if ty is not of kind Type, return a data constructor that will box it, and the type of the boxed thing, which does now have kind Type. See Note [Boxing constructors]

Char

Double

Float

Int

Word

Word8

List

Maybe

Tuples

valuemkTupleTy :: Boxity -> [Type] -> Type

Make a tuple type. The list of types should not include any RuntimeRep specifications. Boxed 1-tuples are flattened. See Note [One-tuples]

valuemkTupleTy1 :: Boxity -> [Type] -> Type

Make a tuple type. The list of types should not include any RuntimeRep specifications. Boxed 1-tuples are *not* flattened. See Note [One-tuples] and Note [Don't flatten tuples from HsSyn] in GHC.Core.Make

valuemkBoxedTupleTy :: [Type] -> Type

Build the type of a small tuple that holds the specified type of thing Flattens 1-tuples. See Note [One-tuples].

Constraint tuples

Any

Recovery TyCon

Sums

Kinds

Equality predicates

RuntimeRep and friends

Levity

Multiplicity and friends

Bignum

Should this name be considered in-scope, even though it technically isn't?

This ensures that we don't filter out information because, e.g., Data.Kind.Type isn't imported.

See Note [pretendNameIsInScope].