HORIZON HASKELLDocslts/ghc-9.14.xd82dee82026-10-12Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · d82dee8 · 2026-10-12

Modulecuddle-1.8.1.0GHC2021

Codec.CBOR.Cuddle.CDDL.Resolve

Module containing tools for resolving CDDL

Resolving the CDDL is a process of simplifying the representation to make further operations, such as CBOR generation or validation, easier. We operate with a number of passes:

  1. First, we deal with any rule extensions and create a single map from identifiers to (potentially parametrised) entities.

  2. Second, we flatten the structure to a CTree, which discards a lot of the extrenuous information.

  3. Then we resolve identifiers. Specifically, we do three things: - Resolve identifiers that map to the postlude. - Differentiate between generic args and references to top-level rules. - Validate that all references exist. Note that we cannot resolve all references since they may be circular.

  4. Finally, we monomorphise, synthesizing instances of rules with their generic arguments bound.

  • 3 types
  • 6 values
  • Packagecuddle-1.8.1.0
  • Exports26
  • LanguageGHC2021
  • LicenceApache-2.0
  • SourceResolve.hs
valuebuildRefCTree :: CDDLMap -> PartialCTreeRoot OrReferenced
#

Build a CTree incorporating references.

This translation cannot fail.

datadata MonoReferenced
#
Instances12HasState, HasSink, IndexMappable, HasReader, HasSource, XXCTree, …
datadata MonoSimplePhase
#

A simplified phase reachable from any of the function-bearing post-mono phases (MonoReferenced, GenPhase, ValidatorPhase). It strips the generator/validator extensions so the tree can be Shown, Eq-compared, and pretty-printed for debug output.

Instances12IndexMappable, Eq, Show, Generic, Pretty, Rep, …
data familydata family XXCTree i
#
Instances19Eq, Show, Generic, Pretty, Hashable, Rep, …
constructorDHRef (DistRef DistReferencedNoGen)
#
constructorDRef (DistRef DistReferenced)
#
constructorOrRef Name [CTree OrReferenced]
#

Reference to another node with possible generic arguments supplied