Library
Module
Module type
Parameter
Class
Class type
include Base.Applicative.S with type 'a t = 'a S.t
type 'a t = 'a S.t
val return : 'a -> 'a t
module Applicative_infix : sig ... end
val select : ('a, 'b) Base.Either.t t -> ('a -> 'b) t -> 'b t
val (<*?) : ('a, 'b) Base.Either.t t -> ('a -> 'b) t -> 'b t
An operator alias for select
, which is sometimes convenient. It tries to follow the notational convention for Applicative
operators. The angle bracket pointing to the left means we always use the corresponding value. The value on the right, however, may be unnecessary, hence the question mark.
val branch : ('a, 'b) Base.Either.t t -> ('a -> 'c) t -> ('b -> 'c) t -> 'c t
The branch
function is a natural generalisation of select
: instead of skipping an unnecessary effect, it chooses which of the two given effectful functions to apply to a given argument; the other effect is unnecessary.
Branch on a Boolean value, skipping unnecessary effects.