This is a wrapper type for booleans, with a specific set of monoidal operations.
The contained bools would become true only if both (all) operands are true.
- Any: Similar wrapper, but using the 'any' criteria.
open FSharpPlus
open FSharpPlus.Data
let res1 = All true ++ zero ++ All false
// val res1 : All = All false
let even x = x % 2 = 0
let res2 = [2;4;6;7;8] |> map (even >> All) |> sum
// val res2 : All = All false
namespace FSharpPlus
namespace FSharpPlus.Data
val res1: All
Multiple items
union case All.All: bool -> All
--------------------
[<Struct>]
type All =
| All of bool
static member (+) : All * All -> All
static member Zero: All
<summary>
Boolean monoid under conjunction.
</summary>
val zero<'Monoid (requires member Zero)> : 'Monoid (requires member Zero)
<summary>
A value that represents the 0 element of a Monoid.
</summary>
<category index="4">Monoid</category>
val even: x: int -> bool
val x: int
val res2: All
val map: f: ('T -> 'U) -> x: 'Functor<'T> -> 'Functor<'U> (requires member Map)
<summary>Lifts a function into a Functor.</summary>
<category index="1">Functor</category>
val sum: x: 'Foldable<'Monoid> -> 'Monoid (requires member Fold and member ``+`` and member Zero)
<summary>
Folds the sum of all monoid elements in the Foldable.
</summary>
<category index="23">Additional Functions</category>