Selective
public protocol Selective : ApplicativeThe Selective typeclass represents Selective Applicative Functors, described in this paper. Selective Applicative Functors enrich Applicative Functors by providing an operation that composes two effectful computations where the second depends on the first.
- 
                  
                  Conditionally applies the second computation based on the result of the first. DeclarationParametersfabA computation that results in an Eithervalue.fA computation that is executed in case the first computation evaluates to a left value. Return ValueComposition of the two computations. 
- 
                  whenS(_:then:)Extension methodEvaluates the second computation when the first evaluates to true.DeclarationParameterscondA computation evaluating to a boolean value. thenA computation that will be evaluated if the first computation evaluates to true.Return ValueComposition of the two computations. 
- 
                  branch(_:ifLeft:ifRight:)Extension methodEvaluates one out of two computations based on the result of another computation. DeclarationParametersfabComputation producing an Eithervalue, to decide which computation is executed afterwards.ifLeftComputation that will be executed if fabevaluates to anEither.leftvalue.ifRightComputation that will be executed if fabevaluates to anEither.rightvalue.Return ValueComposition of the computations. 
- 
                  ifS(_:then:else:)Extension methodEvaluates one out of two computations based on the result of another computation. DeclarationParametersxComputation producing a boolean value to decide which computation is exectured afterwards. thenComputation that will be executed if the first evaluates to true.elseComputation that will be executed if the first evaluates to false.Return ValueComposition of the computations. 
- 
                  orS(_:_:)Extension method
- 
                  andS(_:_:)Extension method
- 
                  fromOptionS(_:_:)Extension methodEvaluates an optional computation, providing a default value for the empty case. DeclarationParametersxDefault value for the empty case. mxA computation resulting in an optional value. Return ValueComposition of the two computations. 
- 
                  anyS(_:_:)Extension methodA lifted version of any. Retains the short-circuiting behavior.DeclarationParameterspA lifted predicate to find any element of the arraythat matches it.arrayAn array to look for an element that matches the predicate in. Return ValueA boolean computation describing if any element of the array matches the predicate. 
- 
                  allS(_:_:)Extension methodA lifted version of all. Retains the short-circuiting behavior.DeclarationParameterspA lifted predicate to check all elements of the arraymatch it.arrayAn array to check if all elements match the predicate. Return ValueA boolean computation describing if all elements of the array match the predicate. 
- 
                  whileS(_:)Extension method
 
             Install in Dash
              Install in Dash
             Selective Protocol Reference
        Selective Protocol Reference