An applicative functor is selective just when it comes with a certain kind of 'selection' operator. Intuitively, the selection operator - which replaces the 'bind' operator of monads - allows conditional choice on when effects are meant to run.
Selective functors are encapsulated by the type class
class Applicative f => Selective f where
select :: f (Either a b) -> f (a -> b) -> f b
where Applicative f
is the type class of applicative functors.
Every monad gives rise to a selective, but not vice versa.
While there are no particular comments in the paper that introduced them, it seems like selective functors come with a lax monoidality
Given , this may be used to construct a morphism
Mokhov, Andrey, Georgy Lukyanov, Simon Marlow, and Jeremie Dimino. 2019. ‘Selective Applicative Functors’. Proceedings of the ACM on Programming Languages 3 (ICFP). https://doi.org/10.1145/3341694.
@article{mokhov_selective_2019,
title = {Selective applicative functors},
volume = {3},
doi = {10.1145/3341694},
number = {ICFP},
journal = {Proceedings of the ACM on Programming Languages},
author = {Mokhov, Andrey and Lukyanov, Georgy and Marlow, Simon and Dimino, Jeremie},
month = jul,
year = {2019}
}