| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Plutarch.Maybe
Synopsis
- data PMaybe (a :: S -> Type) (s :: S)
- pjust :: forall (a :: S -> Type) (s :: S). Term s (a :--> PMaybe a)
- pnothing :: forall (a :: S -> Type) (s :: S). Term s (PMaybe a)
- pisJust :: forall (a :: S -> Type) (s :: S). Term s (PMaybe a :--> PBool)
- pfromJust :: forall (a :: S -> Type) (s :: S). Term s (PMaybe a :--> a)
- ptraceIfNothing :: forall (a :: S -> Type) (s :: S). Term s PString -> Term s (PMaybe a) -> Term s a
- pfromMaybe :: forall (a :: S -> Type) (s :: S). Term s (a :--> (PMaybe a :--> a))
- pmaybe :: forall (b :: S -> Type) (a :: S -> Type) (s :: S). Term s (b :--> ((a :--> b) :--> (PMaybe a :--> b)))
- passertPJust :: forall (a :: S -> Type) (s :: S). Term s (PString :--> (PMaybe a :--> a))
- pmapDropNothing :: forall (b :: S -> Type) (a :: S -> Type) (list :: (S -> Type) -> S -> Type) (s :: S). (PListLike list, PElemConstraint list a, PElemConstraint list b) => Term s ((a :--> PMaybe b) :--> (list a :--> list b))
- pmapMaybe :: forall (a :: S -> Type) (b :: S -> Type) (s :: S). Term s ((a :--> b) :--> (PMaybe a :--> PMaybe b))
Type
data PMaybe (a :: S -> Type) (s :: S) Source #
Since: 1.10.0
Instances
Functions
Constructors
pjust :: forall (a :: S -> Type) (s :: S). Term s (a :--> PMaybe a) Source #
Construct a PJust value.
Since: 1.10.0
pnothing :: forall (a :: S -> Type) (s :: S). Term s (PMaybe a) Source #
Construct a PNothing value.
Since: 1.10.0
Predicates
Eliminators
pmaybe :: forall (b :: S -> Type) (a :: S -> Type) (s :: S). Term s (b :--> ((a :--> b) :--> (PMaybe a :--> b))) Source #
passertPJust :: forall (a :: S -> Type) (s :: S). Term s (PString :--> (PMaybe a :--> a)) Source #
Extract the value stored in a PMaybe container. If there's no value,
throw an error with the given message.
Since: 1.10.0