Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Functions for compiling GHC types into PlutusCore types, as well as compiling constructors, matchers, and pattern match alternatives.
Synopsis
- compileTypeNorm ∷ CompilingDefault uni fun m ann ⇒ Type → m (PIRType uni)
- compileType ∷ CompilingDefault uni fun m ann ⇒ Type → m (PIRType uni)
- compileKind ∷ Compiling uni fun m ann ⇒ Kind → m (Kind ())
- getDataCons ∷ Compiling uni fun m ann ⇒ TyCon → m [DataCon]
- getConstructors ∷ CompilingDefault uni fun m ann ⇒ TyCon → m [PIRTerm uni fun]
- getMatch ∷ CompilingDefault uni fun m ann ⇒ TyCon → m (PIRTerm uni fun)
- getMatchInstantiated ∷ CompilingDefault uni fun m ann ⇒ Type → m (PIRTerm uni fun)
Documentation
compileTypeNorm ∷ CompilingDefault uni fun m ann ⇒ Type → m (PIRType uni) Source #
Compile a type, first of all normalizing it to remove type family redexes.
Generally, we need to call this whenever we are compiling a "new" type from the program.
If we are compiling a part of a type we are already processing then it has likely been
normalized and we can just use compileType
compileType ∷ CompilingDefault uni fun m ann ⇒ Type → m (PIRType uni) Source #
Compile a type.
getConstructors ∷ CompilingDefault uni fun m ann ⇒ TyCon → m [PIRTerm uni fun] Source #
Get the constructors of the given TyCon
as PLC terms.
getMatch ∷ CompilingDefault uni fun m ann ⇒ TyCon → m (PIRTerm uni fun) Source #
Get the matcher of the given TyCon
as a PLC term
getMatchInstantiated ∷ CompilingDefault uni fun m ann ⇒ Type → m (PIRTerm uni fun) Source #
Get the matcher of the given Type
(which must be equal to a type constructor application)
as a PLC term instantiated for the type constructor argument types.