FSharpPlus


Any

This is a wrapper type for booleans, with a specific set of monoidal operations. The contained bools would become true only if one of (any) operands are true.

Related Types

Abstractions

Examples

#r @"nuget: FSharpPlus"
open FSharpPlus
open FSharpPlus.Data

let res1 = Any true ++ zero ++ Any false
// val res1 : Any = Any true

let even x = x % 2 = 0

let res2 = [2;4;6;7;8] |> map (even >> Any) |> sum
// val res2 : Any = Any true
namespace FSharpPlus
namespace FSharpPlus.Data
val res1: Any
Multiple items
union case Any.Any: bool -> Any

--------------------
[<Struct>] type Any = | Any of bool static member (+) : Any * Any -> Any static member Zero: Any
<summary> Boolean monoid under disjunction. </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: Any
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>