IsomorphismNondeterminism
Type members
Inherited classlikes
Value members
Inherited methods
Nondeterministically sequence fs
, collecting the results using a Monoid
.
Nondeterministically sequence fs
, collecting the results using a Monoid
.
- Inherited from
- Nondeterminism
Nondeterministically sequence fs
, collecting the results using
a commutative Monoid
.
Nondeterministically sequence fs
, collecting the results using
a commutative Monoid
.
- Inherited from
- Nondeterminism
- Inherited from
- Apply
- Inherited from
- Apply
- Inherited from
- Apply
- Inherited from
- Apply
- Inherited from
- Apply
- Inherited from
- Apply
- Inherited from
- Apply
- Inherited from
- Apply
- Inherited from
- Apply
- Inherited from
- Apply
- Inherited from
- Apply
- Inherited from
- Apply
- Inherited from
- Apply
- Inherited from
- Apply
Add a unit to any Apply to form an Applicative.
Add a unit to any Apply to form an Applicative.
- Inherited from
- Apply
- Inherited from
- Apply
The composition of Functor F
and Bifunctor G
, [x, y]F[G[x, y]]
, is a Bifunctor
The composition of Functor F
and Bifunctor G
, [x, y]F[G[x, y]]
, is a Bifunctor
- Inherited from
- Functor
Obtain results from both a
and b
, nondeterministically ordering
their effects.
Obtain results from both a
and b
, nondeterministically ordering
their effects.
- Inherited from
- Nondeterminism
A commutative operation which chooses nondeterministically to obtain
a value from either a
or b
. If a
'wins', a 'residual' context
for b
is returned; if b
wins, a residual context for a
is
returned. The residual is useful for various instances like Future
,
which may race the two computations and require a residual to ensure
the result of the 'losing' computation is not discarded.
A commutative operation which chooses nondeterministically to obtain
a value from either a
or b
. If a
'wins', a 'residual' context
for b
is returned; if b
wins, a residual context for a
is
returned. The residual is useful for various instances like Future
,
which may race the two computations and require a residual to ensure
the result of the 'losing' computation is not discarded.
This function can be defined in terms of chooseAny
or vice versa.
The default implementation calls chooseAny
with a
two-element list and uses the Functor
for F
to fix up types.
- Inherited from
- Nondeterminism
A commutative operation which chooses nondeterministically to obtain
a value from any of the elements of as
. In the language of posets, this
constructs an antichain (a set of elements which are all incomparable) in
the effect poset for this computation.
A commutative operation which chooses nondeterministically to obtain
a value from any of the elements of as
. In the language of posets, this
constructs an antichain (a set of elements which are all incomparable) in
the effect poset for this computation.
- Returns
None
, if the input is empty.- Inherited from
- Nondeterminism
The composition of Functors F
and G
, [x]F[G[x]]
, is a Functor
The composition of Functors F
and G
, [x]F[G[x]]
, is a Functor
- Inherited from
- Functor
The composition of Applys F
and G
, [x]F[G[x]]
, is a Apply
The composition of Applys F
and G
, [x]F[G[x]]
, is a Apply
- Inherited from
- Apply
The composition of Applicatives F
and G
, [x]F[G[x]]
, is an Applicative
The composition of Applicatives F
and G
, [x]F[G[x]]
, is an Applicative
- Inherited from
- Applicative
Combine fa
and fb
according to Apply[F]
with a function that discards the A
(s)
Combine fa
and fb
according to Apply[F]
with a function that discards the A
(s)
- Inherited from
- Apply
Combine fa
and fb
according to Apply[F]
with a function that discards the B
(s)
Combine fa
and fb
according to Apply[F]
with a function that discards the B
(s)
- Inherited from
- Apply
Filter l
according to an applicative predicate.
Filter l
according to an applicative predicate.
- Inherited from
- Applicative
Filter l
according to an applicative predicate.
Filter l
according to an applicative predicate.
- Inherited from
- Applicative
Filter map
according to an applicative predicate. *
Filter map
according to an applicative predicate. *
- Inherited from
- Applicative
An Applicative
for F
in which effects happen in the opposite order.
An Applicative
for F
in which effects happen in the opposite order.
- Definition Classes
- Applicative -> Apply
- Inherited from
- Applicative
Repeats an applicative action infinitely
Repeats an applicative action infinitely
- Inherited from
- Apply
Pair all A
s in fa
with the result of function application.
Pair all A
s in fa
with the result of function application.
- Inherited from
- Functor
Nondeterministically gather results from the given sequence of actions.
This function is the nondeterministic analogue of sequence
and should
behave identically to sequence
so long as there is no interaction between
the effects being gathered. However, unlike sequence
, which decides on
a total order of effects, the effects in a gather
are unordered with
respect to each other.
Nondeterministically gather results from the given sequence of actions.
This function is the nondeterministic analogue of sequence
and should
behave identically to sequence
so long as there is no interaction between
the effects being gathered. However, unlike sequence
, which decides on
a total order of effects, the effects in a gather
are unordered with
respect to each other.
Although the effects are unordered, we ensure the order of results
matches the order of the input sequence. Also see gatherUnordered
.
- Inherited from
- Nondeterminism
Nondeterministically gather results from the given sequence of actions
to a list. Same as calling reduceUnordered
with the List
Monoid
.
Nondeterministically gather results from the given sequence of actions
to a list. Same as calling reduceUnordered
with the List
Monoid
.
To preserve the order of the output list while allowing nondetermininstic
ordering of effects, use gather
.
- Inherited from
- Nondeterminism
The composition of Functor F and Contravariant G, [x]F[G[x]]
,
is contravariant.
The composition of Functor F and Contravariant G, [x]F[G[x]]
,
is contravariant.
- Inherited from
- Functor
if
lifted into a binding. Unlike lift3((t,c,a)=>if(t)c else a)
, this will only include context from the chosen of ifTrue
and ifFalse
, not the other.
if
lifted into a binding. Unlike lift3((t,c,a)=>if(t)c else a)
, this will only include context from the chosen of ifTrue
and ifFalse
, not the other.
- Inherited from
- Bind
Execute an action repeatedly until its result satisfies the given predicate and return that result, discarding all others.
Execute an action repeatedly until its result satisfies the given predicate and return that result, discarding all others.
- Inherited from
- Monad
Execute an action repeatedly until its result fails to satisfy the given predicate and return that result, discarding all others.
Execute an action repeatedly until its result fails to satisfy the given predicate and return that result, discarding all others.
- Inherited from
- Monad
Sequence the inner F
of FFA
after the outer F
, forming a
single F[A]
.
Sequence the inner F
of FFA
after the outer F
, forming a
single F[A]
.
- Inherited from
- Bind
- Inherited from
- Apply
- Inherited from
- Apply
- Inherited from
- Apply
- Inherited from
- Apply
- Inherited from
- Apply
- Inherited from
- Apply
- Inherited from
- Apply
Apply a function to the results of a
and b
, nondeterminstically
ordering their effects.
Apply a function to the results of a
and b
, nondeterminstically
ordering their effects.
- Inherited from
- Nondeterminism
Lift apply(a)
, and apply the result to f
.
Lift apply(a)
, and apply the result to f
.
- Inherited from
- Functor
Pair A
with the result of function application.
Pair A
with the result of function application.
- Inherited from
- Bind
Apply a function to 2 results, nondeterminstically ordering their effects, alias of mapBoth
Apply a function to 2 results, nondeterminstically ordering their effects, alias of mapBoth
- Inherited from
- Nondeterminism
Apply a function to 3 results, nondeterminstically ordering their effects
Apply a function to 3 results, nondeterminstically ordering their effects
- Inherited from
- Nondeterminism
Apply a function to 4 results, nondeterminstically ordering their effects
Apply a function to 4 results, nondeterminstically ordering their effects
- Inherited from
- Nondeterminism
Apply a function to 5 results, nondeterminstically ordering their effects
Apply a function to 5 results, nondeterminstically ordering their effects
- Inherited from
- Nondeterminism
Apply a function to 6 results, nondeterminstically ordering their effects
Apply a function to 6 results, nondeterminstically ordering their effects
- Inherited from
- Nondeterminism
A lawful implementation of this that is isomorphic up to the methods defined on Applicative allowing for optimised parallel implementations that would otherwise violate laws of more specific typeclasses (e.g. Monad).
A lawful implementation of this that is isomorphic up to the methods defined on Applicative allowing for optimised parallel implementations that would otherwise violate laws of more specific typeclasses (e.g. Monad).
- Inherited from
- Applicative
Semigroups can be added within an Applicative
Semigroups can be added within an Applicative
- Inherited from
- Applicative
The product of Functors F
and G
, [x](F[x], G[x]])
, is a Functor
The product of Functors F
and G
, [x](F[x], G[x]])
, is a Functor
- Inherited from
- Functor
The product of Applys F
and G
, [x](F[x], G[x]])
, is a Apply
The product of Applys F
and G
, [x](F[x], G[x]])
, is a Apply
- Inherited from
- Apply
The product of Bind F
and G
, [x](F[x], G[x]])
, is a Bind
The product of Bind F
and G
, [x](F[x], G[x]])
, is a Bind
- Inherited from
- Bind
The product of Applicatives F
and G
, [x](F[x], G[x]])
, is an Applicative
The product of Applicatives F
and G
, [x](F[x], G[x]])
, is an Applicative
- Inherited from
- Applicative
The product of Monad F
and G
, [x](F[x], G[x]])
, is a Monad
The product of Monad F
and G
, [x](F[x], G[x]])
, is a Monad
- Inherited from
- Monad
Nondeterministically gather results from the given sequence of actions.
The result will be arbitrarily reordered, depending on the order
results come back in a sequence of calls to chooseAny
.
Nondeterministically gather results from the given sequence of actions.
The result will be arbitrarily reordered, depending on the order
results come back in a sequence of calls to chooseAny
.
- Inherited from
- Nondeterminism
Performs the action n
times, returning the list of results.
Performs the action n
times, returning the list of results.
- Inherited from
- Applicative
Performs the action n
times, returning nothing.
Performs the action n
times, returning nothing.
- Inherited from
- Applicative
- Inherited from
- Apply
Unfold seed
to the right and combine effects left-to-right,
using the given Reducer to combine values.
Implementations may override this method to not unfold more
than is necessary to determine the result.
Returns the given argument if cond
is false
, otherwise, unit lifted into F.
Returns the given argument if cond
is false
, otherwise, unit lifted into F.
- Inherited from
- Applicative
Execute an action repeatedly until the Boolean
condition returns true
.
The condition is evaluated after the loop body. Collects results into an
arbitrary MonadPlus
value, such as a List
.
Execute an action repeatedly until the Boolean
condition returns true
.
The condition is evaluated after the loop body. Collects results into an
arbitrary MonadPlus
value, such as a List
.
- Inherited from
- Monad
Execute an action repeatedly until the Boolean
condition returns true
.
The condition is evaluated after the loop body. Discards results.
Execute an action repeatedly until the Boolean
condition returns true
.
The condition is evaluated after the loop body. Discards results.
- Inherited from
- Monad
Empty fa
of meaningful pure values, preserving its
structure.
Empty fa
of meaningful pure values, preserving its
structure.
- Inherited from
- Functor
Returns the given argument if cond
is true
, otherwise, unit lifted into F.
Returns the given argument if cond
is true
, otherwise, unit lifted into F.
- Inherited from
- Applicative
Execute an action repeatedly as long as the given Boolean
expression
returns true
. The condition is evaluated before the loop body.
Collects the results into an arbitrary MonadPlus
value, such as a List
.
Execute an action repeatedly as long as the given Boolean
expression
returns true
. The condition is evaluated before the loop body.
Collects the results into an arbitrary MonadPlus
value, such as a List
.
- Inherited from
- Monad
Execute an action repeatedly as long as the given Boolean
expression
returns true
. The condition is evaluated before the loop body.
Discards results.
Execute an action repeatedly as long as the given Boolean
expression
returns true
. The condition is evaluated before the loop body.
Discards results.
- Inherited from
- Monad
Functors are covariant by nature, so we can treat an F[A]
as
an F[B]
if A
is a subtype of B
.
Functors are covariant by nature, so we can treat an F[A]
as
an F[B]
if A
is a subtype of B
.
- Inherited from
- Functor
- Inherited from
- InvariantApplicative
- Inherited from
- InvariantApplicative
Converts ma
to a value of type F[B]
using the provided bijection.
Converts ma
to a value of type F[B]
using the provided bijection.
- Inherited from
- InvariantFunctor
Converts ma
to a value of type F[B]
using the provided isomorphism.
Converts ma
to a value of type F[B]
using the provided isomorphism.
- Inherited from
- InvariantFunctor
- Definition Classes
- Inherited from
- IsomorphismApplicative
- Definition Classes
- Inherited from
- IsomorphismApplicative