Module

Control.Selective

Package
purescript-selective
Repository
anttih/purescript-selective

#Selective Source

class (Applicative f) <= Selective f  where

Selective is a typeclass somewhere between Applicative and Monad. It adds the ability to have conditionals on top of Applicatives yet still allows static analyzis of the program.

We can leverage the default Monad implementation for many of the instances since they are Monads anyway. We still get the benefits though.

Members

Instances

#(<*?) Source

Operator alias for Control.Selective.handle (left-associative / precedence 4)

#select Source

select :: forall c b a f. Selective f => f (Either a b) -> f (a -> c) -> f (b -> c) -> f c

#handleM Source

handleM :: forall b a f. Monad f => f (Either a b) -> f (a -> b) -> f b

#ifS Source

ifS :: forall a f. Selective f => f Boolean -> f a -> f a -> f a

#whenS Source

whenS :: forall f. Selective f => f Boolean -> f Unit -> f Unit

#fromMaybeS Source

fromMaybeS :: forall a f. Selective f => f a -> f (Maybe a) -> f a

#orElse Source

orElse :: forall a e f. Selective f => Semigroup e => f (Either e a) -> f (Either e a) -> f (Either e a)

#orS Source

orS :: forall f. Selective f => f Boolean -> f Boolean -> f Boolean

#(<||>) Source

Operator alias for Control.Selective.orS (left-associative / precedence 4)

#andS Source

andS :: forall f. Selective f => f Boolean -> f Boolean -> f Boolean

#(<&&>) Source

Operator alias for Control.Selective.andS (left-associative / precedence 4)