new Any()
The Any monoid. Any can be used to check of any of multiple items are true
- Version:
- 3.0.0
- Source:
Example
const {Any} = require('futils').monoid;
Any(true); // -> Any(true)
Any(true).value; // -> true
Extends
- module:generics/Show
- module:generics/Eq
- module:generics/Ord
Methods
(static) empty() → {Any}
Monoid implementation for Any. Returns a Any of false
- Source:
Returns:
- Type:
-
Any
The empty Any
Example
const {Any} = require('futils').monoid;
Any.empty(); // -> Any(false)
(static) of(a) → {Any}
Lifts a value into a Any. Returns the empty Any for values which are no booleans
- Source:
Parameters:
Name | Type | Description |
---|---|---|
a |
any
|
The value to lift |
Returns:
- Type:
-
Any
A new Any
Example
const {Any} = require('futils').monoid;
Any.of(true); // -> Any(true)
Any.of(null); // -> Any(false)
Any.of({}); // -> Any(false)
concat(a) → {Any}
Concatenates a Any with another using boolean comparison
- Source:
Parameters:
Name | Type | Description |
---|---|---|
a |
Any
|
The Any instance to concatenate with |
Returns:
- Type:
-
Any
A new Any
Example
const {Any} = require('futils').monoid;
const any = Any(true);
any.concat(Any(false)); // -> Any(true)