Module

Control.Selective

Package
purescript-selective-functors
Repository
artemisSystem/purescript-selective-functors

#Selective Source

class Selective :: (Type -> Type) -> Constraintclass (Applicative f, Select f) <= Selective f 

This typeclass extends Select with an identity (pure). Selective is an abstraction that sits between Applicative and Monad.

Instances must satisfy the following laws:

  • Identity: x <*? pure identity = either identity identity <$> x
  • Distributivity: pure x <*? (y *> z) = (pure x <*? y) *> (pure x <*? z)
  • Monad subclass (if f is a Monad): select = selectM

Instances

#anyS Source

anyS :: forall @t @f @a. Selective f => Foldable t => (a -> f Boolean) -> t a -> f Boolean

Short-circuiting any

#allS Source

allS :: forall @t @f @a. Selective f => Foldable t => (a -> f Boolean) -> t a -> f Boolean

Short-circuiting all