Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class PFunctor f => PApply (f :: (S -> Type) -> S -> Type) where
- class PApply f => PApplicative (f :: (S -> Type) -> S -> Type) where
- class PFunctor f => PAlt f where
- class (PApplicative f, PAlt f) => PAlternative f where
- pempty :: forall (a :: PType) (s :: S). PSubcategory f a => Term s (f a)
- (#<*>) :: forall (f :: (S -> Type) -> S -> Type) (a :: S -> Type) (b :: S -> Type) (s :: S). (PSubcategory f (a :--> b), PSubcategory f a, PSubcategory f b, PApply f) => Term s (f (a :--> b)) -> Term s (f a) -> Term s (f b)
- (#*>) :: forall (f :: (S -> Type) -> S -> Type) (a :: S -> Type) (b :: S -> Type) (s :: S). (PSubcategory f a, PSubcategory f b, PApply f) => Term s (f a) -> Term s (f b) -> Term s (f b)
- (#<*) :: forall (f :: (S -> Type) -> S -> Type) (a :: S -> Type) (b :: S -> Type) (s :: S). (PSubcategory f a, PSubcategory f b, PApply f) => Term s (f a) -> Term s (f b) -> Term s (f a)
- (#<!>) :: forall (f :: (S -> Type) -> S -> Type) (a :: S -> Type) (s :: S). (PSubcategory f a, PAlt f) => Term s (f a) -> Term s (f a) -> Term s (f a)
- preplicateA :: forall (ell :: (S -> Type) -> S -> Type) (f :: (S -> Type) -> S -> Type) (a :: S -> Type) (s :: S). (PApplicative f, PListLike ell, PElemConstraint ell a, PSubcategory f (ell a), PSubcategory f a) => Term s (PInteger :--> (f a :--> f (ell a)))
- preplicateA_ :: forall (f :: (S -> Type) -> S -> Type) (b :: S -> Type) (s :: S). (PApplicative f, PBoring b, PSubcategory f b) => Term s (PInteger :--> (f b :--> f b))
- pwhen :: forall (f :: (S -> Type) -> S -> Type) (b :: S -> Type) (s :: S). (PApplicative f, PBoring b, PSubcategory f b) => Term s (PBool :--> (f b :--> f b))
- punless :: forall (f :: (S -> Type) -> S -> Type) (b :: S -> Type) (s :: S). (PApplicative f, PBoring b, PSubcategory f b) => Term s (PBool :--> (f b :--> f b))
- ppureIf :: forall (f :: PType -> PType) (a :: PType) (s :: S). (PAlternative f, PSubcategory f a) => Term s (PBool :--> (a :--> f a))
Type classes
class PFunctor f => PApply (f :: (S -> Type) -> S -> Type) where Source #
Since: 1.0.0
pliftA2 :: forall (a :: S -> Type) (b :: S -> Type) (c :: S -> Type) (s :: S). (PSubcategory f a, PSubcategory f b, PSubcategory f c) => Term s ((a :--> (b :--> c)) :--> (f a :--> (f b :--> f c))) Source #
Instances
PApply PIdentity Source # | Since: 1.0.0 |
PApply PSum Source # | Since: 1.0.0 |
PApply PMaybeData Source # | Since: 1.0.0 |
Defined in Plutarch.Extra.Applicative pliftA2 :: forall (a :: S -> Type) (b :: S -> Type) (c :: S -> Type) (s :: S). (PSubcategory PMaybeData a, PSubcategory PMaybeData b, PSubcategory PMaybeData c) => Term s ((a :--> (b :--> c)) :--> (PMaybeData a :--> (PMaybeData b :--> PMaybeData c))) Source # | |
PApply PBuiltinList Source # | Since: 1.0.0 |
Defined in Plutarch.Extra.Applicative pliftA2 :: forall (a :: S -> Type) (b :: S -> Type) (c :: S -> Type) (s :: S). (PSubcategory PBuiltinList a, PSubcategory PBuiltinList b, PSubcategory PBuiltinList c) => Term s ((a :--> (b :--> c)) :--> (PBuiltinList a :--> (PBuiltinList b :--> PBuiltinList c))) Source # | |
PApply PList Source # | Since: 1.0.0 |
PApply PMaybe Source # | Since: 1.0.0 |
(forall (s :: S). Semigroup (Term s a)) => PApply (PConst a) Source # | Since: 1.0.0 |
PApply (PState s) Source # | Since: 1.0.0 |
(PIsData a, forall (s :: S). Semigroup (Term s (PAsData a))) => PApply (PDThese a) Source # | Since: 1.0.0 |
(forall (s :: S). Semigroup (Term s a)) => PApply (PThese a) Source # | Since: 1.0.0 |
PApply (PEither e) Source # | Forwards the first Since: 1.0.0 |
(forall (s :: S). Semigroup (Term s a)) => PApply (PPair a) Source # | Since: 1.0.0 |
PApply f => PApply (PStar f a) Source # | Strengthening to Since: 3.0.1 |
PApply (PTagged tag) Source # | Since: 1.0.0 |
Defined in Plutarch.Extra.Tagged |
class PApply f => PApplicative (f :: (S -> Type) -> S -> Type) where Source #
Since: 1.0.0
Instances
class PFunctor f => PAlt f where Source #
Laws:
(a #<!> b) #<!> c = a #<!> (b #<!> c) f #<$> (a #<!> b) = (f #<$> a) #<!> (f #<$> b)
Since: 3.14.1
Instances
PAlt PMaybeData Source # | Since: 3.14.1 |
Defined in Plutarch.Extra.Applicative palt :: forall (a :: PType) (s :: S). PSubcategory PMaybeData a => Term s (PMaybeData a :--> (PMaybeData a :--> PMaybeData a)) Source # | |
PAlt PBuiltinList Source # | Since: 3.14.1 |
Defined in Plutarch.Extra.Applicative palt :: forall (a :: PType) (s :: S). PSubcategory PBuiltinList a => Term s (PBuiltinList a :--> (PBuiltinList a :--> PBuiltinList a)) Source # | |
PAlt PList Source # | Since: 3.14.1 |
PAlt PMaybe Source # | Since: 3.14.1 |
PAlt (PEither a) Source # | Since: 3.14.1 |
class (PApplicative f, PAlt f) => PAlternative f where Source #
Laws:
pempty #<!> x = x x #<!> pempty = x (a #<!> b) #<*> c = (a #<*> c) #<!> (b #<*> c)
Since: 3.14.1
Instances
PAlternative PMaybeData Source # | Since: 3.14.1 |
Defined in Plutarch.Extra.Applicative pempty :: forall (a :: PType) (s :: S). PSubcategory PMaybeData a => Term s (PMaybeData a) Source # | |
PAlternative PBuiltinList Source # | Since: 3.14.1 |
Defined in Plutarch.Extra.Applicative pempty :: forall (a :: PType) (s :: S). PSubcategory PBuiltinList a => Term s (PBuiltinList a) Source # | |
PAlternative PList Source # | Since: 3.14.1 |
Defined in Plutarch.Extra.Applicative | |
PAlternative PMaybe Source # | Since: 3.14.1 |
Defined in Plutarch.Extra.Applicative |
Functions
(#<*>) :: forall (f :: (S -> Type) -> S -> Type) (a :: S -> Type) (b :: S -> Type) (s :: S). (PSubcategory f (a :--> b), PSubcategory f a, PSubcategory f b, PApply f) => Term s (f (a :--> b)) -> Term s (f a) -> Term s (f b) infixl 4 Source #
Since: 1.0.0
(#*>) :: forall (f :: (S -> Type) -> S -> Type) (a :: S -> Type) (b :: S -> Type) (s :: S). (PSubcategory f a, PSubcategory f b, PApply f) => Term s (f a) -> Term s (f b) -> Term s (f b) infixl 4 Source #
Since: 1.0.0
(#<*) :: forall (f :: (S -> Type) -> S -> Type) (a :: S -> Type) (b :: S -> Type) (s :: S). (PSubcategory f a, PSubcategory f b, PApply f) => Term s (f a) -> Term s (f b) -> Term s (f a) infixl 4 Source #
Since: 1.0.0
(#<!>) :: forall (f :: (S -> Type) -> S -> Type) (a :: S -> Type) (s :: S). (PSubcategory f a, PAlt f) => Term s (f a) -> Term s (f a) -> Term s (f a) infixl 3 Source #
Since: 3.14.1
preplicateA :: forall (ell :: (S -> Type) -> S -> Type) (f :: (S -> Type) -> S -> Type) (a :: S -> Type) (s :: S). (PApplicative f, PListLike ell, PElemConstraint ell a, PSubcategory f (ell a), PSubcategory f a) => Term s (PInteger :--> (f a :--> f (ell a))) Source #
preplicateA
n
comp
repeats comp
n
times (0 if n
is negative),
collects the results into a PListLike
, and returns a single computation
producing them all.
Notes
The type of the PListLike
is left flexible: you can set it using
TypeApplications
. We put that type parameter first to make this easier.
Since: 1.2.0
preplicateA_ :: forall (f :: (S -> Type) -> S -> Type) (b :: S -> Type) (s :: S). (PApplicative f, PBoring b, PSubcategory f b) => Term s (PInteger :--> (f b :--> f b)) Source #
As preplicateA
, but ignores the results.
Since: 1.2.0
pwhen :: forall (f :: (S -> Type) -> S -> Type) (b :: S -> Type) (s :: S). (PApplicative f, PBoring b, PSubcategory f b) => Term s (PBool :--> (f b :--> f b)) Source #