| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
PlutusIR.Compiler.Datatype
Description
Functions for compiling let-bound PIR datatypes into PLC.
Synopsis
- compileDatatype :: Compiling m uni fun a => Recursivity -> PIRTerm uni fun a -> Datatype TyName Name uni (Provenance a) -> m (PIRTerm uni fun a)
- compileDatatypeDefs :: MonadQuote m => Datatype TyName Name uni a -> m (Type TyName uni a) #
Make the type of a destructor for a
Datatype.mkDestructorTy List = forall (a :: *) . List a -> forall (out_List :: *) . (out_List -> (a -> List a -> out_List) -> out_List)
mkScottTy :: MonadQuote m => ann -> Datatype TyName Name uni ann -> m (Type TyName uni ann) #
Make the "Scott-encoded" type for a Datatype, with type variables free.
This is exactly the type of an eliminator function for the datatype.
mkScottTy Maybe = forall out_Maybe. out_Maybe -> (a -> out_Maybe) -> out_Maybe
resultTypeName :: MonadQuote m => Datatype TyName Name uni a -> m TyName #