| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Plutarch.Either
Synopsis
- data PEither (a :: S -> Type) (b :: S -> Type) (s :: S)
- data PEitherData (a :: S -> Type) (b :: S -> Type) (s :: S)
- pisLeft :: forall (a :: S -> Type) (b :: S -> Type) (s :: S). Term s (PEither a b :--> PBool)
- pfromLeft :: forall (a :: S -> Type) (b :: S -> Type) (s :: S). Term s (PEither a b :--> a)
- pfromRight :: forall (a :: S -> Type) (b :: S -> Type) (s :: S). Term s (PEither a b :--> b)
- pdleft :: forall (a :: S -> Type) (b :: S -> Type) (s :: S). PIsData a => Term s (a :--> PEitherData a b)
- pdright :: forall (a :: S -> Type) (b :: S -> Type) (s :: S). PIsData b => Term s (b :--> PEitherData a b)
- 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)))
- pdisLeft :: forall (a :: S -> Type) (b :: S -> Type) (s :: S). Term s (PEitherData a b :--> PBool)
- pdisRight :: forall (a :: S -> Type) (b :: S -> Type) (s :: S). Term s (PEitherData a b :--> PBool)
- pdfromLeft :: forall (a :: S -> Type) (b :: S -> Type) (s :: S). PIsData a => Term s (PEitherData a b :--> a)
- pdfromRight :: forall (a :: S -> Type) (b :: S -> Type) (s :: S). PIsData b => Term s (PEitherData a b :--> b)
Types
data PEither (a :: S -> Type) (b :: S -> Type) (s :: S) Source #
SOP-encoded Either.
Since: 1.10.0
Instances
data PEitherData (a :: S -> Type) (b :: S -> Type) (s :: S) Source #
Data-encoded Either.
Since: 1.10.0
Instances
| (PTryFrom PData a, PTryFrom PData b) => PTryFrom PData (PAsData (PEitherData a b)) Source # | Since: 1.10.0 | ||||||||
Defined in Plutarch.Either Associated Types
| |||||||||
| (PTryFrom PData a, PTryFrom PData b) => PTryFrom PData (PEitherData a b) Source # | Since: 1.10.0 | ||||||||
Defined in Plutarch.Either Associated Types
| |||||||||
| PEq (PEitherData a b) Source # | Since: 1.10.0 | ||||||||
Defined in Plutarch.Either Methods (#==) :: forall (s :: S). Term s (PEitherData a b) -> Term s (PEitherData a b) -> Term s PBool Source # | |||||||||
| PIsData (PEitherData a b) Source # | Since: 1.10.0 | ||||||||
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 # | |||||||||
| (ToData (AsHaskell a), FromData (AsHaskell a), ToData (AsHaskell b), FromData (AsHaskell b)) => PLiftable (PEitherData a b) Source # | |||||||||
Defined in Plutarch.Either Associated Types
Methods haskToRepr :: AsHaskell (PEitherData a b) -> PlutusRepr (PEitherData a b) Source # reprToHask :: PlutusRepr (PEitherData a b) -> Either LiftError (AsHaskell (PEitherData a b)) Source # reprToPlut :: forall (s :: S). PlutusRepr (PEitherData a b) -> PLifted s (PEitherData a b) Source # plutToRepr :: (forall (s :: S). PLifted s (PEitherData a b)) -> Either LiftError (PlutusRepr (PEitherData a b)) Source # | |||||||||
| (POrd a, POrd b, PIsData a, PIsData b) => POrd (PEitherData a b) Source # | Since: 1.10.0 | ||||||||
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 # 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 # | |||||||||
| PlutusType (PEitherData a b) Source # | Since: 1.10.0 | ||||||||
Defined in Plutarch.Either Associated Types
Methods pcon' :: forall (s :: S). PEitherData a b s -> Term s (PInner (PEitherData a b)) Source # pmatch' :: forall (s :: S) (b0 :: S -> Type). 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: 1.10.0 | ||||||||
Defined in Plutarch.Either | |||||||||
| Generic (PEitherData a b s) Source # | |||||||||
Defined in Plutarch.Either Associated Types
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 # | |||||||||
Defined in Plutarch.Either type PTryFromExcess PData (PAsData (PEitherData a b)) = PTryFromExcess PData (PInner (PAsData (PEitherData a b))) | |||||||||
| type PTryFromExcess PData (PEitherData a b) Source # | |||||||||
Defined in Plutarch.Either | |||||||||
| type AsHaskell (PEitherData a b) Source # | Since: 1.10.0 | ||||||||
Defined in Plutarch.Either type AsHaskell (PEitherData a b) = AsHaskell (DeriveDataPLiftable (PEitherData a b) (Either (AsHaskell a) (AsHaskell b))) | |||||||||
| type PlutusRepr (PEitherData a b) Source # | |||||||||
Defined in Plutarch.Either type PlutusRepr (PEitherData a b) = PlutusRepr (DeriveDataPLiftable (PEitherData a b) (Either (AsHaskell a) (AsHaskell b))) | |||||||||
| type PInner (PEitherData a b) Source # | |||||||||
Defined in Plutarch.Either | |||||||||
| type Rep (PEitherData a b s) Source # | Since: 1.10.0 | ||||||||
Defined in Plutarch.Either type Rep (PEitherData a b s) = D1 ('MetaData "PEitherData" "Plutarch.Either" "plutarch-1.14.0-6fw3gqGsL7f3TFINWPu1lG" '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
PEither
Elimination
pisLeft :: forall (a :: S -> Type) (b :: S -> Type) (s :: S). Term s (PEither a b :--> PBool) Source #
Since: 1.10.0
pfromLeft :: forall (a :: S -> Type) (b :: S -> Type) (s :: S). Term s (PEither a b :--> a) Source #
Since: 1.10.0
pfromRight :: forall (a :: S -> Type) (b :: S -> Type) (s :: S). Term s (PEither a b :--> b) Source #
Since: 1.10.0
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: 1.10.0
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: 1.10.0
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: 1.10.0
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: 1.10.0
pdisRight :: forall (a :: S -> Type) (b :: S -> Type) (s :: S). Term s (PEitherData a b :--> PBool) Source #
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: 1.10.0
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: 1.10.0