| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Ply.Plutarch
Synopsis
- type family PlyArgOf a = r | r -> a
- writeTypedScript :: TypedWriter pt => Config -> Text -> FilePath -> ClosedTerm pt -> IO ()
- mkEnvelope :: forall ptype. TypedWriter ptype => Config -> Text -> ClosedTerm ptype -> Either Text TypedScriptEnvelope
- toTypedScript :: forall ptype. TypedWriter ptype => Config -> ClosedTerm ptype -> Either Text (TypedScript (RoleOf ptype) (PlyParamsOf (ParamsOf ptype)))
Documentation
type family PlyArgOf a = r | r -> a Source #
PlyArgOf yields the corresponding Haskell type for a given Plutarch type.
Instances
Arguments
| :: TypedWriter pt | |
| => Config | Plutarch compiler configuration which will be used to compile the script. |
| -> Text | Description to be associated with the compiled script file, semantically irrelevant. |
| -> FilePath | File path to save the file to. |
| -> ClosedTerm pt | The parameterized Plutarch validator/minting policy. |
| -> IO () |
Write a parameterized Plutarch validator or minting policy into the filesystem.
The result can be read by readTypedScript.
Please also see: typedWriterInfo.
mkEnvelope :: forall ptype. TypedWriter ptype => Config -> Text -> ClosedTerm ptype -> Either Text TypedScriptEnvelope Source #
Wrapper around toTypedScript that builds a TypedScriptEnvelope to serialize into the file system.
toTypedScript :: forall ptype. TypedWriter ptype => Config -> ClosedTerm ptype -> Either Text (TypedScript (RoleOf ptype) (PlyParamsOf (ParamsOf ptype))) Source #
The core `ply-plutarch` function: obtain all the necessary information about a Plutarch script, and turn it into TypedScript.
For a description of extra parameters are determined, see: PlyParamsOf and ParamsOf type families.
For a description of ScriptVersion is determined, see: VersionOf type family.
For a description of ScriptRole is determined, see: RoleOf type family.