plutarch-1.9.0
Safe HaskellSafe-Inferred
LanguageGHC2021

Plutarch.Either

Synopsis

Types

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

Scott-encoded Either.

Constructors

PLeft (Term s a) 
PRight (Term s b) 

Instances

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

Defined in Plutarch.Either

Methods

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

(PLiftable a, PLiftable b) => PLiftable (PEither a b) Source #

@since WIP

Instance details

Defined in Plutarch.Either

Associated Types

type AsHaskell (PEither a b) Source #

type PlutusRepr (PEither a b) Source #

DerivePlutusType (PEither a b) Source # 
Instance details

Defined in Plutarch.Either

Associated Types

type DPTStrat (PEither a b) Source #

PlutusType (PEither a b) Source # 
Instance details

Defined in Plutarch.Either

Associated Types

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

type PCovariant' (PEither a b) Source #

type PContravariant' (PEither a b) Source #

type PVariant' (PEither a b) Source #

Methods

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

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

(PShow a, PShow b) => PShow (PEither a b) Source # 
Instance details

Defined in Plutarch.Either

Methods

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

Generic (PEither a b s) Source # 
Instance details

Defined in Plutarch.Either

Associated Types

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

Methods

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

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

type AsHaskell (PEither a b) Source # 
Instance details

Defined in Plutarch.Either

type PlutusRepr (PEither a b) Source # 
Instance details

Defined in Plutarch.Either

type DPTStrat (PEither a b) Source # 
Instance details

Defined in Plutarch.Either

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

Defined in Plutarch.Either

type PCovariant' (PEither a b) Source # 
Instance details

Defined in Plutarch.Either

type PCovariant' (PEither a b)
type PInner (PEither a b) Source # 
Instance details

Defined in Plutarch.Either

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

Defined in Plutarch.Either

type PVariant' (PEither a b)
type Rep (PEither a b s) Source # 
Instance details

Defined in Plutarch.Either

type Rep (PEither a b s) = D1 ('MetaData "PEither" "Plutarch.Either" "plutarch-1.9.0-DaxzFvLNVysDL1hkJ4YFrw" 'False) (C1 ('MetaCons "PLeft" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s a))) :+: C1 ('MetaCons "PRight" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s b))))

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

Data-encoded Either.

@since WIP

Constructors

PDLeft (Term s (PAsData a)) 
PDRight (Term s (PAsData b)) 

Instances

Instances details
(PTryFrom PData a, PTryFrom PData b) => PTryFrom PData (PAsData (PEitherData a b)) Source #

@since WIP

Instance details

Defined in Plutarch.Either

Associated Types

type PTryFromExcess PData (PAsData (PEitherData a b)) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PAsData (PEitherData a b)), Reduce (PTryFromExcess PData (PAsData (PEitherData a b)) s)) -> Term s r) -> Term s r Source #

(PTryFrom PData a, PTryFrom PData b) => PTryFrom PData (PEitherData a b) Source #

@since WIP

Instance details

Defined in Plutarch.Either

Associated Types

type PTryFromExcess PData (PEitherData a b) :: PType Source #

Methods

ptryFrom' :: forall (s :: S) (r :: PType). Term s PData -> ((Term s (PEitherData a b), Reduce (PTryFromExcess PData (PEitherData a b) s)) -> Term s r) -> Term s r Source #

PIsData (PEitherData a b) Source #

@since WIP

Instance details

Defined in Plutarch.Either

Methods

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

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

PEq (PEitherData a b) Source #

@since WIP

Instance details

Defined in Plutarch.Either

Methods

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

(ToData (AsHaskell a), FromData (AsHaskell a), ToData (AsHaskell b), FromData (AsHaskell b)) => PLiftable (PEitherData a b) Source # 
Instance details

Defined in Plutarch.Either

Associated Types

type AsHaskell (PEitherData a b) Source #

type PlutusRepr (PEitherData a b) Source #

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

@since WIP

Instance details

Defined in Plutarch.Either

Methods

pmax :: forall (s :: S). Term s (PEitherData a b) -> Term s (PEitherData a b) -> Term s (PEitherData a b) Source #

pmin :: forall (s :: S). Term s (PEitherData a b) -> Term s (PEitherData a b) -> Term s (PEitherData a b) Source #

(PPartialOrd a, PPartialOrd b, PIsData a, PIsData b) => PPartialOrd (PEitherData a b) Source #

@since WIP

Instance details

Defined in Plutarch.Either

Methods

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

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

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

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

PlutusType (PEitherData a b) Source #

@since WIP

Instance details

Defined in Plutarch.Either

Methods

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

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

(PIsData a, PIsData b, PShow a, PShow b) => PShow (PEitherData a b) Source #

@since WIP

Instance details

Defined in Plutarch.Either

Methods

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

Generic (PEitherData a b s) Source # 
Instance details

Defined in Plutarch.Either

Associated Types

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

Methods

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

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

type PTryFromExcess PData (PAsData (PEitherData a b)) Source # 
Instance details

Defined in Plutarch.Either

type PTryFromExcess PData (PEitherData a b) Source # 
Instance details

Defined in Plutarch.Either

type AsHaskell (PEitherData a b) Source #

@since WIP

Instance details

Defined in Plutarch.Either

type PlutusRepr (PEitherData a b) Source # 
Instance details

Defined in Plutarch.Either

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

Defined in Plutarch.Either

type PCovariant' (PEitherData a b) Source # 
Instance details

Defined in Plutarch.Either

type PInner (PEitherData a b) Source # 
Instance details

Defined in Plutarch.Either

type PInner (PEitherData a b) = PData
type PVariant' (PEitherData a b) Source # 
Instance details

Defined in Plutarch.Either

type Rep (PEitherData a b s) Source #

@since WIP

Instance details

Defined in Plutarch.Either

type Rep (PEitherData a b s) = D1 ('MetaData "PEitherData" "Plutarch.Either" "plutarch-1.9.0-DaxzFvLNVysDL1hkJ4YFrw" 'False) (C1 ('MetaCons "PDLeft" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s (PAsData a)))) :+: C1 ('MetaCons "PDRight" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s (PAsData b)))))

Functions

PEitherData

Construction

pdleft :: forall (a :: S -> Type) (b :: S -> Type) (s :: S). PIsData a => Term s (a :--> PEitherData a b) Source #

Make a Data-encoded Left.

@since WIP

pdright :: forall (a :: S -> Type) (b :: S -> Type) (s :: S). PIsData b => Term s (b :--> PEitherData a b) Source #

Make a Data-encoded Right.

@since WIP

Elimination

peitherData :: forall (a :: S -> Type) (b :: S -> Type) (r :: S -> Type) (s :: S). (PIsData a, PIsData b) => Term s ((a :--> r) :--> ((b :--> r) :--> (PEitherData a b :--> r))) Source #

Eliminator for PEitherData.

@since WIP

pdisLeft :: forall (a :: S -> Type) (b :: S -> Type) (s :: S). Term s (PEitherData a b :--> PBool) Source #

Verifies if a PEitherData is a PDLeft. Less code than using peitherData, as it doesn't need to inspect the contents.

@since WIP

pdisRight :: forall (a :: S -> Type) (b :: S -> Type) (s :: S). Term s (PEitherData a b :--> PBool) Source #

As pdisLeft, except verifies whether we have a PDRight.

@since WIP

pdfromLeft :: forall (a :: S -> Type) (b :: S -> Type) (s :: S). PIsData a => Term s (PEitherData a b :--> a) Source #

Return the value inside a PDEither if it's a PDLeft, error otherwise.

@since WIP

pdfromRight :: forall (a :: S -> Type) (b :: S -> Type) (s :: S). PIsData b => Term s (PEitherData a b :--> b) Source #

As pdfromLeft, but yields a value if given a PDRight instead.

@since WIP