Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Plutarch.Repr.Derive
Synopsis
- newtype DerivePLiftableAsRepr (wrapper :: S -> Type) (h :: Type) (s :: S) = DerivePLiftableAsRepr (wrapper s)
Documentation
newtype DerivePLiftableAsRepr (wrapper :: S -> Type) (h :: Type) (s :: S) Source #
This is PLiftable
derivation helper for user-defined datatypes like Data/SOP encoded types.
Please consult example below.
@@ data PBobData (a :: S -> Type) (s :: S) = PBobData (Term s (PAsData a)) (Term s (PAsData PBool)) deriving stock (Generic) deriving anyclass (SOP.Generic) deriving PlutusType via (DeriveAsDataRec (PBobData a)) -- SOP encoding works as well.
deriving via DerivePLiftableAsRepr (PBobData a) (Bob (AsHaskell a)) instance PLiftable (PAsData a) => PLiftable (PBobData a) @@
@since WIP
Constructors
DerivePLiftableAsRepr (wrapper s) |