HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduleghc-9.10.3GHC2021

GHC.Parser.Types

  • 3 types
  • 1 value
  • Packageghc-9.10.3
  • Exports4
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceTypes.hs
datadata PatBuilder p
#
Instances10Outputable, DisambECP, Anno, Body, FunArg, InfixOp, …
datadata DataConBuilder
#

An accumulator to build a prefix data constructor, e.g. when parsing MkT A B C, the accumulator will evolve as follows:

 1. PrefixDataConBuilder []        MkT
 2. PrefixDataConBuilder [A]       MkT
 3. PrefixDataConBuilder [A, B]    MkT
 4. PrefixDataConBuilder [A, B, C] MkT
 

There are two reasons we have a separate builder type instead of using HsConDeclDetails GhcPs directly:

  1. It's faster, because OrdList gives us constant-time snoc.

  2. Having a separate type helps ensure that we don't forget to finalize a RecTy into a RecCon (we do that in dataConBuilderDetails).

See Note [PatBuilder] for another builder type used in the parser. Here the technique is similar, but the motivation is different.

Instances2Outputable, DisambTD