| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Plutarch.Unsafe
Synopsis
- punsafeBuiltin :: forall (s :: S) (a :: S -> Type). DefaultFun -> Term s a
- punsafeCoerce :: forall (b :: S -> Type) (a :: S -> Type) (s :: S). Term s a -> Term s b
- punsafeDowncast :: forall (s :: S) (a :: S -> Type). Term s (PInner a) -> Term s a
- punsafeCase :: forall (a :: S -> Type) (b :: S -> Type) (s :: S). Term s a -> [Term s POpaque] -> Term s b
Documentation
punsafeCoerce :: forall (b :: S -> Type) (a :: S -> Type) (s :: S). 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.
punsafeDowncast :: forall (s :: S) (a :: S -> Type). Term s (PInner a) -> Term s a Source #
Unsafely coerce from the PInner representation of a Term,
assuming that the value is a safe construction of the Term.
punsafeCase :: forall (a :: S -> Type) (b :: S -> Type) (s :: S). Term s a -> [Term s POpaque] -> Term s b Source #
Construct a Case statement in UPLC. The first argument is what will be
matched on, while the second argument will be used as handlers.
Important note
No attempt will (or even can) be made to check that the handlers have correct types, or that the number of handlers is appropriate for the type being handled. Crashes or misbehaviour can and will occur if you get this wrong!
Since: 1.13.0