Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- newtype ((a :: PType) :--> (b :: PType)) (s :: S) = PLam (Term s a -> Term s b)
- data PDelayed (a :: PType) (s :: S)
- newtype Term (s :: S) (a :: PType) = Term {
- asRawTerm :: Word64 -> TermMonad TermResult
- asClosedRawTerm :: ClosedTerm a -> TermMonad TermResult
- newtype Script = Script (Program DeBruijn DefaultUni DefaultFun ())
- mapTerm :: (RawTerm -> RawTerm) -> TermResult -> TermResult
- plam' :: (Term s a -> Term s b) -> Term s (a :--> b)
- plet :: Term s a -> (Term s a -> Term s b) -> Term s b
- papp :: HasCallStack => Term s (a :--> b) -> Term s a -> Term s b
- pdelay :: Term s a -> Term s (PDelayed a)
- pforce :: Term s (PDelayed a) -> Term s a
- phoistAcyclic :: HasCallStack => ClosedTerm a -> Term s a
- perror :: Term s a
- punsafeCoerce :: Term s a -> Term s b
- punsafeBuiltin :: DefaultFun -> Term s a
- punsafeConstant :: Some (ValueOf DefaultUni) -> Term s a
- punsafeConstantInternal :: Some (ValueOf DefaultUni) -> Term s a
- compile :: Config -> ClosedTerm a -> Either Text Script
- compile' :: TermResult -> UTerm
- type ClosedTerm (a :: PType) = forall (s :: S). Term s a
- type Dig = Digest Blake2b_160
- hashTerm :: Config -> ClosedTerm a -> Either Text Dig
- hashRawTerm :: RawTerm -> Dig
- data RawTerm
- data TermResult = TermResult {}
- data S = SI
- type PType = S -> Type
- pthrow :: HasCallStack => Text -> Term s a
- newtype Config = Config {}
- data TracingMode
- pgetConfig :: (Config -> Term s a) -> Term s a
- newtype TermMonad m = TermMonad {
- runTermMonad :: ReaderT Config (Either Text) m
- (#) :: HasCallStack => Term s (a :--> b) -> Term s a -> Term s b
- (#$) :: HasCallStack => Term s (a :--> b) -> Term s a -> Term s b
Documentation
$hoisted
newtype ((a :: PType) :--> (b :: PType)) (s :: S) infixr 0 Source #
Instances
PlutusType (a :--> b) Source # | |
Defined in Plutarch.Internal.PlutusType | |
type PContravariant' (a :--> b) Source # | |
Defined in Plutarch.Internal.PlutusType | |
type PCovariant' (a :--> b) Source # | |
Defined in Plutarch.Internal.PlutusType | |
type PInner (a :--> b) Source # | |
Defined in Plutarch.Internal.PlutusType | |
type PVariant' (a :--> b) Source # | |
Defined in Plutarch.Internal.PlutusType |
$term
newtype Term (s :: S) (a :: PType) Source #
Term | |
|
Instances
asClosedRawTerm :: ClosedTerm a -> TermMonad TermResult Source #
Instances
Generic Script Source # | |
Show Script Source # | |
Eq Script Source # | |
type Rep Script Source # | |
Defined in Plutarch.Script type Rep Script = D1 ('MetaData "Script" "Plutarch.Script" "plutarch-1.3.0-287WdR4V4qr3NTh5i3Je4I" 'True) (C1 ('MetaCons "Script" 'PrefixI 'True) (S1 ('MetaSel ('Just "unScript") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Program DeBruijn DefaultUni DefaultFun ())))) |
mapTerm :: (RawTerm -> RawTerm) -> TermResult -> TermResult Source #
plam' :: (Term s a -> Term s b) -> Term s (a :--> b) Source #
Lambda abstraction.
Only works with a single argument.
Use plam
instead, to support currying.
plet :: Term s a -> (Term s a -> Term s b) -> Term s b Source #
Let bindings.
This is appoximately a shorthand for a lambda and application:
plet v f
== papp (plam f) v
But sufficiently small terms in WHNF may be inlined for efficiency.
pforce :: Term s (PDelayed a) -> Term s a Source #
Plutus 'force',
used to force evaluation of PDelayed
terms.
phoistAcyclic :: HasCallStack => ClosedTerm a -> Term s a Source #
Plutus 'error'.
When using this explicitly, it should be ensured that the containing term is delayed, avoiding premature evaluation.
punsafeCoerce :: Term s a -> Term s b Source #
Unsafely coerce the type-tag of a Term.
This should mostly be avoided, though it can be safely used to assert known types of Datums, Redeemers or ScriptContext.
punsafeBuiltin :: DefaultFun -> Term s a Source #
punsafeConstant :: Some (ValueOf DefaultUni) -> Term s a Source #
Deprecated: Use pconstant
instead.
punsafeConstantInternal :: Some (ValueOf DefaultUni) -> Term s a Source #
compile :: Config -> ClosedTerm a -> Either Text Script Source #
Compile a (closed) Plutus Term to a usable script
compile' :: TermResult -> UTerm Source #
type ClosedTerm (a :: PType) = forall (s :: S). Term s a Source #
- Closed* terms with no free variables.
type Dig = Digest Blake2b_160 Source #
hashRawTerm :: RawTerm -> Dig Source #
data TermResult Source #
Instances
PEq (PUnit :: S -> Type) Source # | |
POrd (PUnit :: S -> Type) Source # | |
Defined in Plutarch.Unit | |
PPartialOrd (PUnit :: S -> Type) Source # | |
PIsData (PUnit :: S -> Type) Source # | |
PlutusType (PUnit :: S -> Type) Source # | |
Defined in Plutarch.Unit | |
PUnsafeLiftDecl (PUnit :: S -> Type) Source # | |
PShow (PUnit :: S -> Type) Source # | |
Monoid (Term s (PUnit :: S -> Type)) Source # | |
Semigroup (Term s (PUnit :: S -> Type)) Source # | |
type PContravariant' (PUnit :: S -> Type) Source # | |
Defined in Plutarch.Unit | |
type PCovariant' (PUnit :: S -> Type) Source # | |
Defined in Plutarch.Unit | |
type PInner (PUnit :: S -> Type) Source # | |
type PVariant' (PUnit :: S -> Type) Source # | |
Defined in Plutarch.Unit | |
type PLifted (PUnit :: S -> Type) Source # | |
Defined in Plutarch.Unit |