Module
Control.Selective.ComposeTS
- Package
- purescript-selective-functors
- Repository
- artemisSystem/purescript-selective-functors
#ComposeTS Source
newtype ComposeTS :: forall k1 k2. (k2 -> Type) -> (k1 -> k2) -> k1 -> Type
newtype ComposeTS f g a
This newtype provides a Select
instance for Compose
.
It "lifts" the Traversable
g
into the Selective
f
. ComposeTS
does
this in a way that works well when the g
/inner type is like Tuple
or
Maybe
, never containing more than one a
. More details in the
documentation for the Select
instance. See ComposeTM
for a different
implementation that's better suited for arrays.
Constructors
ComposeTS (f (g a))
Instances
Newtype (ComposeTS f g a) _
Generic (ComposeTS f g a) _
(Show (f (g a))) => Show (ComposeTS f g a)
(Eq1 f, Eq1 g, Eq a) => Eq (ComposeTS f g a)
(Eq1 f, Eq1 g) => Eq1 (ComposeTS f g)
(Ord1 f, Ord1 g, Ord a) => Ord (ComposeTS f g a)
(Ord1 f, Ord1 g) => Ord1 (ComposeTS f g)
(Functor f, Functor g) => Functor (ComposeTS f g)
(Apply f, Apply g) => Apply (ComposeTS f g)
(Applicative f, Applicative g) => Applicative (ComposeTS f g)
(Select f, Apply g, Traversable g) => Select (ComposeTS f g)
(Selective f, Applicative g, Traversable g) => Selective (ComposeTS f g)
(Alt f, Functor g) => Alt (ComposeTS f g)
(Plus f, Functor g) => Plus (ComposeTS f g)
(Alternative f, Applicative g) => Alternative (ComposeTS f g)
- Modules
- Control.
Select - Control.
Selective - Control.
Selective. ComposeI - Control.
Selective. ComposeTM - Control.
Selective. ComposeTS - Control.
Selective. Free - Control.
Selective. Over - Control.
Selective. SelectA - Control.
Selective. SelectM - Control.
Selective. SelectTM - Control.
Selective. SelectTS - Control.
Selective. Under - Control.
Selective. Validation
This newtype provides a
Select
instance forCompose
. It "lifts" theTraversable
g
into theSelective
f
.This instance works best when the traversable type never has more than one "slot", like
Maybe
orTuple
. Ifg
does have more than one slot, likeArray
, oneLeft
in the first argument toselect
makes it as if every element was that specificLeft
, replacing anyRight
s and subsequentLeft
s. SeeComposeTM
for an instance that works better with types likeArray
.