liqwid-plutarch-extra-3.21.1: A collection of Plutarch extras from Liqwid Labs
Safe HaskellSafe-Inferred
LanguageHaskell2010

Plutarch.Extra.These

Synopsis

Types

data PThese (a :: S -> Type) (b :: S -> Type) (s :: S) Source #

A data type which contains an a, a b, or both. This uses a Scott-encoded representation.

Since: 1.0.0

Constructors

PThis (Term s a) 
PThat (Term s b) 
PThese (Term s a) (Term s b) 

Instances

Instances details
PBifunctor PThese Source #

Since: 3.1.0

Instance details

Defined in Plutarch.Extra.These

Associated Types

type PSubcategoryLeft PThese :: (S -> Type) -> Constraint Source #

type PSubcategoryRight PThese :: (S -> Type) -> Constraint Source #

Methods

pbimap :: forall (a :: S -> Type) (b :: S -> Type) (c :: S -> Type) (d :: S -> Type) (s :: S). (PSubcategoryLeft PThese a, PSubcategoryLeft PThese c, PSubcategoryRight PThese b, PSubcategoryRight PThese d) => Term s ((a :--> c) :--> ((b :--> d) :--> (PThese a b :--> PThese c d))) Source #

pfirst :: forall (a :: S -> Type) (b :: S -> Type) (c :: S -> Type) (s :: S). (PSubcategoryLeft PThese a, PSubcategoryLeft PThese c, PSubcategoryRight PThese b) => Term s ((a :--> c) :--> (PThese a b :--> PThese c b)) Source #

psecond :: forall (a :: S -> Type) (b :: S -> Type) (d :: S -> Type) (s :: S). (PSubcategoryLeft PThese a, PSubcategoryRight PThese b, PSubcategoryRight PThese d) => Term s ((b :--> d) :--> (PThese a b :--> PThese a d)) Source #

(forall (s :: S). Semigroup (Term s a)) => PApplicative (PThese a) Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Extra.These

Methods

ppure :: forall (a0 :: S -> Type) (s :: S). PSubcategory (PThese a) a0 => Term s (a0 :--> PThese a a0) Source #

(forall (s :: S). Semigroup (Term s a)) => PApply (PThese a) Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Extra.These

Methods

pliftA2 :: forall (a0 :: S -> Type) (b :: S -> Type) (c :: S -> Type) (s :: S). (PSubcategory (PThese a) a0, PSubcategory (PThese a) b, PSubcategory (PThese a) c) => Term s ((a0 :--> (b :--> c)) :--> (PThese a a0 :--> (PThese a b :--> PThese a c))) Source #

PFunctor (PThese a) Source #

Since: 3.1.0

Instance details

Defined in Plutarch.Extra.These

Associated Types

type PSubcategory (PThese a) :: (S -> Type) -> Constraint Source #

Methods

pfmap :: forall (a0 :: S -> Type) (b :: S -> Type) (s :: S). (PSubcategory (PThese a) a0, PSubcategory (PThese a) b) => Term s ((a0 :--> b) :--> (PThese a a0 :--> PThese a b)) Source #

pfconst :: forall (a0 :: S -> Type) (b :: S -> Type) (s :: S). (PSubcategory (PThese a) a0, PSubcategory (PThese a) b) => Term s (a0 :--> (PThese a b :--> PThese a a0)) Source #

PTraversable (PThese a) Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Extra.These

Methods

ptraverse :: forall (f :: (S -> Type) -> S -> Type) (a0 :: S -> Type) (b :: S -> Type) (s :: S). (PApplicative f, PSubcategory f a0, PSubcategory f b, PSubcategory f (PThese a b), PSubcategory (PThese a) a0, PSubcategory (PThese a) b) => Term s ((a0 :--> f b) :--> (PThese a a0 :--> f (PThese a b))) Source #

ptraverse_ :: forall (b :: S -> Type) (f :: (S -> Type) -> S -> Type) (a0 :: S -> Type) (s :: S). (PApplicative f, PSubcategory f b, PBoring b, PSubcategory (PThese a) a0) => Term s ((a0 :--> f b) :--> (PThese a a0 :--> f b)) Source #

(forall (s' :: S). Monoid (Term s' a), forall (s' :: S). Monoid (Term s' b)) => Monoid (Term s (PThese a b)) Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Extra.These

Methods

mempty :: Term s (PThese a b) Source #

mappend :: Term s (PThese a b) -> Term s (PThese a b) -> Term s (PThese a b) Source #

mconcat :: [Term s (PThese a b)] -> Term s (PThese a b) Source #

(forall (s' :: S). Semigroup (Term s' a), forall (s' :: S). Semigroup (Term s' b)) => Semigroup (Term s (PThese a b)) Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Extra.These

Methods

(<>) :: Term s (PThese a b) -> Term s (PThese a b) -> Term s (PThese a b) Source #

sconcat :: NonEmpty (Term s (PThese a b)) -> Term s (PThese a b) Source #

stimes :: Integral b0 => b0 -> Term s (PThese a b) -> Term s (PThese a b) Source #

(PEq a, PEq b) => PEq (PThese a b) Source # 
Instance details

Defined in Plutarch.Extra.These

Methods

(#==) :: forall (s :: S). Term s (PThese a b) -> Term s (PThese a b) -> Term s PBool Source #

(POrd a, POrd b) => PPartialOrd (PThese a b) Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Extra.These

Methods

(#<=) :: forall (s :: S). Term s (PThese a b) -> Term s (PThese a b) -> Term s PBool Source #

(#<) :: forall (s :: S). Term s (PThese a b) -> Term s (PThese a b) -> Term s PBool Source #

DerivePlutusType (PThese a b) Source # 
Instance details

Defined in Plutarch.Extra.These

Associated Types

type DPTStrat (PThese a b) Source #

PlutusType (PThese a b) Source # 
Instance details

Defined in Plutarch.Extra.These

Associated Types

type PInner (PThese a b) :: PType Source #

type PCovariant' (PThese a b) Source #

type PContravariant' (PThese a b) Source #

type PVariant' (PThese a b) Source #

Methods

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

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

(PShow a, PShow b) => PShow (PThese a b) Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Extra.These

Methods

pshow' :: forall (s :: S). Bool -> Term s (PThese a b) -> Term s PString Source #

Generic (PThese a b s) Source # 
Instance details

Defined in Plutarch.Extra.These

Associated Types

type Rep (PThese a b s) :: Type -> Type Source #

Methods

from :: PThese a b s -> Rep (PThese a b s) x Source #

to :: Rep (PThese a b s) x -> PThese a b s Source #

type PSubcategoryLeft PThese Source # 
Instance details

Defined in Plutarch.Extra.These

type PSubcategoryRight PThese Source # 
Instance details

Defined in Plutarch.Extra.These

type PSubcategory (PThese a) Source # 
Instance details

Defined in Plutarch.Extra.These

type DPTStrat (PThese a b) Source # 
Instance details

Defined in Plutarch.Extra.These

type PContravariant' (PThese a b) Source # 
Instance details

Defined in Plutarch.Extra.These

type PContravariant' (PThese a b) = All2 PContravariant'' (PCode (PThese a b))
type PCovariant' (PThese a b) Source # 
Instance details

Defined in Plutarch.Extra.These

type PCovariant' (PThese a b) = All2 PCovariant'' (PCode (PThese a b))
type PInner (PThese a b) Source # 
Instance details

Defined in Plutarch.Extra.These

type PInner (PThese a b) = DerivedPInner (DPTStrat (PThese a b)) (PThese a b)
type PVariant' (PThese a b) Source # 
Instance details

Defined in Plutarch.Extra.These

type PVariant' (PThese a b) = All2 PVariant'' (PCode (PThese a b))
type Rep (PThese a b s) Source # 
Instance details

Defined in Plutarch.Extra.These

type Rep (PThese a b s) = D1 ('MetaData "PThese" "Plutarch.Extra.These" "liqwid-plutarch-extra-3.21.1-KPadsMN5oqEA2Ctxwq6qig" 'False) (C1 ('MetaCons "PThis" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s a))) :+: (C1 ('MetaCons "PThat" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s b))) :+: C1 ('MetaCons "PThese" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s a)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s b)))))

data PDThese (a :: S -> Type) (b :: S -> Type) (s :: S) Source #

As PThese, but using a Data encoding instead.

Since: 1.0.0

Constructors

PDThis (Term s (PDataRecord '["_0" := a])) 
PDThat (Term s (PDataRecord '["_0" := b])) 
PDThese (Term s (PDataRecord '["_0" := a, "_1" := b])) 

Instances

Instances details
PBifunctor PDThese Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Extra.These

Methods

pbimap :: forall (a :: S -> Type) (b :: S -> Type) (c :: S -> Type) (d :: S -> Type) (s :: S). (PSubcategoryLeft PDThese a, PSubcategoryLeft PDThese c, PSubcategoryRight PDThese b, PSubcategoryRight PDThese d) => Term s ((a :--> c) :--> ((b :--> d) :--> (PDThese a b :--> PDThese c d))) Source #

pfirst :: forall (a :: S -> Type) (b :: S -> Type) (c :: S -> Type) (s :: S). (PSubcategoryLeft PDThese a, PSubcategoryLeft PDThese c, PSubcategoryRight PDThese b) => Term s ((a :--> c) :--> (PDThese a b :--> PDThese c b)) Source #

psecond :: forall (a :: S -> Type) (b :: S -> Type) (d :: S -> Type) (s :: S). (PSubcategoryLeft PDThese a, PSubcategoryRight PDThese b, PSubcategoryRight PDThese d) => Term s ((b :--> d) :--> (PDThese a b :--> PDThese a d)) Source #

(forall (s :: S). Semigroup (Term s (PAsData a)), PIsData a) => PApplicative (PDThese a) Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Extra.These

Methods

ppure :: forall (a0 :: S -> Type) (s :: S). PSubcategory (PDThese a) a0 => Term s (a0 :--> PDThese a a0) Source #

(PIsData a, forall (s :: S). Semigroup (Term s (PAsData a))) => PApply (PDThese a) Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Extra.These

Methods

pliftA2 :: forall (a0 :: S -> Type) (b :: S -> Type) (c :: S -> Type) (s :: S). (PSubcategory (PDThese a) a0, PSubcategory (PDThese a) b, PSubcategory (PDThese a) c) => Term s ((a0 :--> (b :--> c)) :--> (PDThese a a0 :--> (PDThese a b :--> PDThese a c))) Source #

PIsData a => PFunctor (PDThese a) Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Extra.These

Associated Types

type PSubcategory (PDThese a) :: (S -> Type) -> Constraint Source #

Methods

pfmap :: forall (a0 :: S -> Type) (b :: S -> Type) (s :: S). (PSubcategory (PDThese a) a0, PSubcategory (PDThese a) b) => Term s ((a0 :--> b) :--> (PDThese a a0 :--> PDThese a b)) Source #

pfconst :: forall (a0 :: S -> Type) (b :: S -> Type) (s :: S). (PSubcategory (PDThese a) a0, PSubcategory (PDThese a) b) => Term s (a0 :--> (PDThese a b :--> PDThese a a0)) Source #

PEq (PDThese a b) Source # 
Instance details

Defined in Plutarch.Extra.These

Methods

(#==) :: forall (s :: S). Term s (PDThese a b) -> Term s (PDThese a b) -> Term s PBool Source #

(POrd a, POrd b, PIsData a, PIsData b) => POrd (PDThese a b) Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Extra.These

(POrd a, POrd b, PIsData a, PIsData b) => PPartialOrd (PDThese a b) Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Extra.These

Methods

(#<=) :: forall (s :: S). Term s (PDThese a b) -> Term s (PDThese a b) -> Term s PBool Source #

(#<) :: forall (s :: S). Term s (PDThese a b) -> Term s (PDThese a b) -> Term s PBool Source #

PIsData (PDThese a b) Source # 
Instance details

Defined in Plutarch.Extra.These

Methods

pfromDataImpl :: forall (s :: S). Term s (PAsData (PDThese a b)) -> Term s (PDThese a b) Source #

pdataImpl :: forall (s :: S). Term s (PDThese a b) -> Term s PData Source #

DerivePlutusType (PDThese a b) Source #

Since: 1.0.0

Instance details

Defined in Plutarch.Extra.These

Associated Types

type DPTStrat (PDThese a b) Source #

PlutusType (PDThese a b) Source # 
Instance details

Defined in Plutarch.Extra.These

Associated Types

type PInner (PDThese a b) :: PType Source #

type PCovariant' (PDThese a b) Source #

type PContravariant' (PDThese a b) Source #

type PVariant' (PDThese a b) Source #

Methods

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

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

Generic (PDThese a b s) Source # 
Instance details

Defined in Plutarch.Extra.These

Associated Types

type Rep (PDThese a b s) :: Type -> Type Source #

Methods

from :: PDThese a b s -> Rep (PDThese a b s) x Source #

to :: Rep (PDThese a b s) x -> PDThese a b s Source #

type PSubcategoryLeft PDThese Source # 
Instance details

Defined in Plutarch.Extra.These

type PSubcategoryRight PDThese Source # 
Instance details

Defined in Plutarch.Extra.These

type PSubcategory (PDThese a) Source # 
Instance details

Defined in Plutarch.Extra.These

type DPTStrat (PDThese a b) Source # 
Instance details

Defined in Plutarch.Extra.These

type PContravariant' (PDThese a b) Source # 
Instance details

Defined in Plutarch.Extra.These

type PContravariant' (PDThese a b) = All2 PContravariant'' (PCode (PDThese a b))
type PCovariant' (PDThese a b) Source # 
Instance details

Defined in Plutarch.Extra.These

type PCovariant' (PDThese a b) = All2 PCovariant'' (PCode (PDThese a b))
type PInner (PDThese a b) Source # 
Instance details

Defined in Plutarch.Extra.These

type PInner (PDThese a b) = DerivedPInner (DPTStrat (PDThese a b)) (PDThese a b)
type PVariant' (PDThese a b) Source # 
Instance details

Defined in Plutarch.Extra.These

type PVariant' (PDThese a b) = All2 PVariant'' (PCode (PDThese a b))
type Rep (PDThese a b s) Source # 
Instance details

Defined in Plutarch.Extra.These

type Rep (PDThese a b s) = D1 ('MetaData "PDThese" "Plutarch.Extra.These" "liqwid-plutarch-extra-3.21.1-KPadsMN5oqEA2Ctxwq6qig" 'False) (C1 ('MetaCons "PDThis" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s (PDataRecord '["_0" := a])))) :+: (C1 ('MetaCons "PDThat" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s (PDataRecord '["_0" := b])))) :+: C1 ('MetaCons "PDThese" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s (PDataRecord '["_0" := a, "_1" := b]))))))

Functions

pthese :: forall (a :: S -> Type) (b :: S -> Type) (c :: S -> Type) (s :: S). Term s ((a :--> c) :--> ((b :--> c) :--> ((a :--> (b :--> c)) :--> (PThese a b :--> c)))) Source #

Case analysis for PThese.

Since: 1.0.0

pdthese :: forall (a :: S -> Type) (b :: S -> Type) (c :: S -> Type) (s :: S). (PIsData a, PIsData b) => Term s ((a :--> c) :--> ((b :--> c) :--> ((a :--> (b :--> c)) :--> (PDThese a b :--> c)))) Source #

Case analysis for PDThese.

Since: 1.0.0

toPDThese :: forall (a :: S -> Type) (b :: S -> Type) (s :: S). (PIsData a, PIsData b) => Term s (PThese a b :--> PDThese a b) Source #

Convert a PThese into a PDThese, assuming PData instances for both 'sides'.

Since: 1.0.0

fromPDThese :: forall (a :: S -> Type) (b :: S -> Type) (s :: S). (PIsData a, PIsData b) => Term s (PDThese a b :--> PThese a b) Source #

Convert a PDThese into a PThese.

Since: 1.0.0