HORIZON HASKELLDocslts/ghc-9.14.x99ffbb82026-10-19Search packagesCtrl K
Theme: |

GHC 9.14.1 · lts/ghc-9.14.x · 99ffbb8 · 2026-10-19

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.

Synopsis
  • 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, …

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