plutarch-1.9.0
Safe HaskellSafe-Inferred
LanguageGHC2021

Plutarch.Repr.Tag

Synopsis

Documentation

newtype PTag (struct :: [S -> Type]) (s :: S) Source #

@since WIP

Constructors

PTag 

Fields

Instances

Instances details
PlutusType (PTag struct) Source # 
Instance details

Defined in Plutarch.Repr.Tag

Associated Types

type PInner (PTag struct) :: PType Source #

type PCovariant' (PTag struct) Source #

type PContravariant' (PTag struct) Source #

type PVariant' (PTag struct) Source #

Methods

pcon' :: forall (s :: S). PTag struct s -> Term s (PInner (PTag struct)) Source #

pmatch' :: forall (s :: S) (b :: PType). Term s (PInner (PTag struct)) -> (PTag struct s -> Term s b) -> Term s b Source #

Generic (PTag struct s) Source # 
Instance details

Defined in Plutarch.Repr.Tag

Associated Types

type Rep (PTag struct s) :: Type -> Type Source #

Methods

from :: PTag struct s -> Rep (PTag struct s) x Source #

to :: Rep (PTag struct s) x -> PTag struct s Source #

Generic (PTag struct s) Source #

@since WIP

Instance details

Defined in Plutarch.Repr.Tag

Associated Types

type Code (PTag struct s) :: [[Type]]

Methods

from :: PTag struct s -> Rep (PTag struct s)

to :: Rep (PTag struct s) -> PTag struct s

type PContravariant' (PTag struct) Source # 
Instance details

Defined in Plutarch.Repr.Tag

type PCovariant' (PTag struct) Source # 
Instance details

Defined in Plutarch.Repr.Tag

type PCovariant' (PTag struct) = PCovariant' (DeriveAsNewtype (PTag struct))
type PInner (PTag struct) Source #

@since WIP

Instance details

Defined in Plutarch.Repr.Tag

type PInner (PTag struct) = PInner (DeriveAsNewtype (PTag struct))
type PVariant' (PTag struct) Source # 
Instance details

Defined in Plutarch.Repr.Tag

type PVariant' (PTag struct) = PVariant' (DeriveAsNewtype (PTag struct))
type Rep (PTag struct s) Source # 
Instance details

Defined in Plutarch.Repr.Tag

type Rep (PTag struct s) = D1 ('MetaData "PTag" "Plutarch.Repr.Tag" "plutarch-1.9.0-FtN0mhIoM9oEvz7Q98pjWP" 'True) (C1 ('MetaCons "PTag" 'PrefixI 'True) (S1 ('MetaSel ('Just "unPTag") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s PInteger))))
type Code (PTag struct s) Source # 
Instance details

Defined in Plutarch.Repr.Tag

type Code (PTag struct s) = GCode (PTag struct s)

newtype DeriveAsTag (a :: S -> Type) s Source #

@since WIP

Constructors

DeriveAsTag 

Fields

Instances

Instances details
(forall (s :: S). TagTypeConstraints s a struct) => PlutusType (DeriveAsTag a) Source #

This derives tag-only PlutusType automatically. Resulted instances will use PInteger as underlying type, making this much more efficient than using regular DataScottSOP based encoding. As name suggests, types with no-argument constructors can use this.

Example: @@ data PFoo s = A | B | C | D | E deriving stock (GHC.Generic, Show) deriving anyclass (PEq, PIsData) deriving (PlutusType, PLiftable) via DeriveAsTag PFoo

instance SOP.Generic (PFoo s) @@

@since WIP

Instance details

Defined in Plutarch.Repr.Tag

Methods

pcon' :: forall (s :: S). DeriveAsTag a s -> Term s (PInner (DeriveAsTag a)) Source #

pmatch' :: forall (s :: S) (b :: PType). Term s (PInner (DeriveAsTag a)) -> (DeriveAsTag a s -> Term s b) -> Term s b Source #

type PContravariant' (DeriveAsTag a) Source # 
Instance details

Defined in Plutarch.Repr.Tag

type PCovariant' (DeriveAsTag a) Source # 
Instance details

Defined in Plutarch.Repr.Tag

type PInner (DeriveAsTag a) Source # 
Instance details

Defined in Plutarch.Repr.Tag

type PVariant' (DeriveAsTag a) Source # 
Instance details

Defined in Plutarch.Repr.Tag

newtype TagLiftHelper r struct Source #

@since WIP

Constructors

TagLiftHelper 

Fields