Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- data PData (s :: S)
- pfstBuiltin :: Term s (PBuiltinPair a b :--> a)
- psndBuiltin :: Term s (PBuiltinPair a b :--> b)
- pasConstr :: Term s (PData :--> PBuiltinPair PInteger (PBuiltinList PData))
- pasMap :: Term s (PData :--> PBuiltinList (PBuiltinPair PData PData))
- pasList :: Term s (PData :--> PBuiltinList PData)
- pasInt :: Term s (PData :--> PInteger)
- plistData :: Term s (PBuiltinList PData :--> PData)
- pconstantData :: forall (p :: S -> Type) (h :: Type) (s :: S). (ToData h, AsHaskell p ~ h) => h -> Term s (PAsData p)
- pconstrBuiltin :: Term s (PInteger :--> (PBuiltinList PData :--> PAsData (PBuiltinPair PInteger (PBuiltinList PData))))
- pasByteStr :: Term s (PData :--> PByteString)
- data PBuiltinPair (a :: S -> Type) (b :: S -> Type) (s :: S)
- data PBuiltinList (a :: S -> Type) (s :: S)
- = PCons (Term s a) (Term s (PBuiltinList a))
- | PNil
- pdataLiteral :: Data -> Term s PData
- class PIsData a where
- pdata :: PIsData a => Term s a -> Term s (PAsData a)
- pfromData :: PIsData a => Term s (PAsData a) -> Term s a
- data PAsData (a :: S -> Type) (s :: S)
- pforgetData :: forall s a. Term s (PAsData a) -> Term s PData
- prememberData :: forall (p :: (S -> Type) -> S -> Type) (s :: S). PVariant p => Proxy p -> Term s (p PData) -> Term s (p (PAsData PData))
- prememberData' :: forall a (p :: (S -> Type) -> S -> Type) (s :: S). (PSubtype PData a, PVariant p) => Proxy p -> Term s (p a) -> Term s (p (PAsData a))
- pserialiseData :: Term s (PData :--> PByteString)
- ppairDataBuiltin :: Term s (PAsData a :--> (PAsData b :--> PBuiltinPair (PAsData a) (PAsData b)))
- pchooseListBuiltin :: Term s (PBuiltinList a :--> (b :--> (b :--> b)))
- pchooseData :: Term s (PData :--> (a :--> (a :--> (a :--> (a :--> (a :--> a))))))
- newtype PDataNewtype (a :: S -> Type) (s :: S) = PDataNewtype (Term s (PAsData a))
Documentation
Instances
pfstBuiltin :: Term s (PBuiltinPair a b :--> a) Source #
psndBuiltin :: Term s (PBuiltinPair a b :--> b) Source #
pasConstr :: Term s (PData :--> PBuiltinPair PInteger (PBuiltinList PData)) Source #
pasMap :: Term s (PData :--> PBuiltinList (PBuiltinPair PData PData)) Source #
pconstantData :: forall (p :: S -> Type) (h :: Type) (s :: S). (ToData h, AsHaskell p ~ h) => h -> Term s (PAsData p) Source #
Create a Plutarch-level PAsData
constant, from a Haskell value.
Example:
> pconstantData @PInteger 42
pconstrBuiltin :: Term s (PInteger :--> (PBuiltinList PData :--> PAsData (PBuiltinPair PInteger (PBuiltinList PData)))) Source #
pasByteStr :: Term s (PData :--> PByteString) Source #
data PBuiltinPair (a :: S -> Type) (b :: S -> Type) (s :: S) Source #
Plutus BuiltinPair
Instances
data PBuiltinList (a :: S -> Type) (s :: S) Source #
Plutus BuiltinList
PCons (Term s a) (Term s (PBuiltinList a)) | |
PNil |
Instances
class PIsData a where Source #
Laws:
- If PSubtype PData a
, then pdataImpl a
must be pupcast
.
- pdataImpl . pupcast . pfromDataImpl ≡ id
- pfromDataImpl . punsafeDowncast . pdataImpl ≡ id
Nothing
Instances
data PAsData (a :: S -> Type) (s :: S) Source #
Instances
prememberData :: forall (p :: (S -> Type) -> S -> Type) (s :: S). PVariant p => Proxy p -> Term s (p PData) -> Term s (p (PAsData PData)) Source #
Inverse of pforgetData'
.
prememberData' :: forall a (p :: (S -> Type) -> S -> Type) (s :: S). (PSubtype PData a, PVariant p) => Proxy p -> Term s (p a) -> Term s (p (PAsData a)) Source #
Like prememberData
but generalised.
pserialiseData :: Term s (PData :--> PByteString) Source #
Serialise any builtin data to its cbor represented by a builtin bytestring
ppairDataBuiltin :: Term s (PAsData a :--> (PAsData b :--> PBuiltinPair (PAsData a) (PAsData b))) Source #
pchooseListBuiltin :: Term s (PBuiltinList a :--> (b :--> (b :--> b))) Source #
newtype PDataNewtype (a :: S -> Type) (s :: S) Source #
Since: 1.7.0
PDataNewtype (Term s (PAsData a)) |