HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleinline-c-0.9.1.10Haskell2010

Language.C.Types

Views of C datatypes. While Language.C.Types.Parse defines datatypes for representing the concrete syntax tree of C types, this module provides friendlier views of C types, by turning them into a data type matching more closely how we read and think about types, both in Haskell and in C. To appreciate the difference, look at the difference between ParameterDeclaration and ParameterDeclaration.

As a bonus, routines are provided for describing types in natural language (English) -- see describeParameterDeclaration and describeType.

  • 14 types
  • 15 values

Types

12 declarations
newtypenewtype CIdentifier
#

A type for C identifiers.

Instances6Eq, Ord, Show, IsString, Hashable, Pretty
datadata ArrayType i
#
Instances6Functor, Foldable, Traversable, Eq, Show, Pretty
datadata Type i
#
Instances6Functor, Foldable, Traversable, Eq, Show, Pretty
  • Functor TypeDefined in inline-c-0.9.1.10 · Language.C.Types
  • Foldable TypeDefined in inline-c-0.9.1.10 · Language.C.Types
  • Traversable TypeDefined in inline-c-0.9.1.10 · Language.C.Types
  • Eq i => Eq (Type i)Defined in inline-c-0.9.1.10 · Language.C.Types
  • Show i => Show (Type i)Defined in inline-c-0.9.1.10 · Language.C.Types
  • Pretty i => Pretty (Type i)Defined in inline-c-0.9.1.10 · Language.C.Types
datadata TypeSpecifier
#
Instances4Eq, Ord, Show, Pretty
datadata Sign
#
Instances3Eq, Ord, Show
  • Eq SignDefined in inline-c-0.9.1.10 · Language.C.Types
  • Ord SignDefined in inline-c-0.9.1.10 · Language.C.Types
  • Show SignDefined in inline-c-0.9.1.10 · Language.C.Types
datadata ParameterDeclaration i
#
Instances6Functor, Foldable, Traversable, Eq, Show, Pretty

Parsing

12 declarations

All the parsing is done using the type classes provided by the parsers package. You can use the parsing routines with any of the parsers that implement the classes, such as parsec or trifecta.

We parametrize the parsing by the type of the variable identifiers, i. We do so because we use this parser to implement anti-quoters referring to Haskell variables, and thus we need to parse Haskell identifiers in certain positions.

Convert to and from high-level views

3 declarations

To english

2 declarations