| Safe Haskell | Safe-Inferred |
|---|---|
| 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
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