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