0.0.10Type: Symbols
takes an immutable, a key array, and an updater, and applies the updater function to the entity at the key path.
Type: function (Immut, Array<any>, Func): (Immut | void)
Immut:
the copy of the immutable with the updated value
takes an immutable collection and returns the raw pojo data.
Type: function (i: Immut): any
(Immut)
immutable species
any:
a reference to the immut's data
takes a shape template and JSON like and parses it to match the shape.
Type: function (s: (Shape | any), d: any): (Immut | Leaf | void)
(Immut | Leaf | void):
the data parsed to match the shape
takes an immutable collection and a key and returns the entity from the collection that the key refences.
Type: function (i: Immut, k: any): any
(Immut)
immutable species
(any)
of member
any:
an entity from the collection
takes an immutable, a key array, and returns the member nested at the key
Type: function (i: Immut, ks: Array<any>): (any | void)
(Immut)
to get nested member in
(Array<any>)
of the path to get member at
(any)
| Name | Description |
|---|---|
$1.k any
|
|
$1.ks ...any
|
any:
the member at the key path
takes an immutable, a key array, and a value, and applies the value to the entity at the key path.
Type: function (i: Immut, ks: Array<any>, v: any): (Immut | void)
(Immut)
to setIn f to
(Array<any>)
of the path to setIn to
(Func)
to setIn
(any)
| Name | Description |
|---|---|
$1.k any
|
|
$1.ks ...any
|
(any)
Immut:
the copy of the immutable with the updated value
takes an immutable and returns the size of the collection.
Type: function (i: Immut): number
(Immut)
to find size of
number:
size of immutable collection
takes an immutable, a key array, and an updater, and applies the updater function to the entity at the key path.
Type: function (i: Immut, ks: Array<any>, f: Func): (Immut | void)
(Immut)
to updateIn f to
(Array<any>)
of the path to updateIn to
(Func)
to updateIn
(any)
| Name | Description |
|---|---|
$1.k any
|
|
$1.ks ...any
|
Immut:
the copy of the immutable with the updated value
takes two immutable lists and returns a new combined list. list two is concatenated to the end of list one.
Type: function (l1: List, l2: List): List
(List)
to concat
(any)
to be predicate
List:
a new list of combined l1 && l2.
takes a list and an index and returns a new list with the entity at the index removed.
Type: function (l: List, i: number): List
(List)
to delete value from
(number)
index to delete the value at
List:
without value at i
tests all entities against the predicate, until one returns false. if one returns false list.every returns false, else true.
Type: function (l: List, f: Func): boolean
(List)
to check if every
(Func)
to be predicate
boolean:
if predicate returns true for all entities
takes a list and a predicate and returns a new list consisting of the elements which pass the predicate.
Type: function (l: List, f: Func): List
(List)
to filter
(any)
to be predicate
List:
of elements that pass the predicate
takes a list and a predicate and returns the first item in the list to pass the predicate. if no item passes the predicate the return is null.
Type: function (l: List, f: Func): (any | null)
(List)
to find item in
(any)
to be predicate
(any | null):
the first item to pass the predicate or null
takes a list and a predicate and returns the index of first item in the list to pass the predicate. if no item passes the predicate the return is -1.
Type: function (l: List, f: Func): number
(List)
to find index in
(any)
to be predicate
number:
the first item to pass the predicate or -1
takes a list and an accumulator and an initial value. it applies the accumulator for each value in the list allong with the current value from the accumulator starting with the initial value
Type: function (l: List, f: Func, i: any): any
(List)
to fold
(any)
accumulator
(any)
initial accum value
any:
the final value from the accumulator
const accumulator = (acc, n) => acc + n
const initialVal = 0
const aList = list.of([1, 1, 1])
list.fold(aList, accumulator, initialVal) // returns 3
is a predicate for whether an entity exists in a list
Type: function (l: List, v: any): boolean
(List)
to search in
(any)
to be predicate
bool:
whether an entity exists in the list
takes a list and an entity and returns the index of the entity in the list. if the entity does not exist in the list then the return is -1.
Type: function (l: List, i: any): number
(List)
to indexOf
(any)
to find index of
number:
the index of the entity or -1
takes a list and a function and applies the function to each entity in the list returning a list of the updated entities.
Type: function (l: List, f: Func): List
(List)
to map
(any)
to be mapping function
List:
of the updated entities
takes a list like type and constructs a new list.
Type: function (s: (List | Array<any>)): List
((Array<any> | List)?= [])
of data to build list from
List:
takes a predicate and uses it to partition the list into a list pair. for each entity if the predicate returns true the entity will be in the first list, else the second.
Type: function (l: List, f: Func): [List, List]
(List)
to partition
(Func)
predicate
[List, List]:
pair of lists, left true, right false.
takes a list and returns a new list minus the last entity
Type: function (l: List): List
(List)
push value on
List:
with all values same as list minus the last entity
takes a list and a value and returns a new list with the value at the end
Type: function (l: List, v: any): List
(List)
push value on
(any)
to push
List:
a list copy with the value at the end
takes a list, an index and a value. returns a new list with the value at the index set as the new value.
Type: function (l: List, k: any, v: any): List
(List)
to set value on
(any)
is the index of the value to get
(any)
to set on list
List:
a new list with the value at k set as v
tests all entities against the predicate until one returns true. if one returns true list.some returns true else returns false.
Type: function (l: List, f: Func): boolean
(List)
to check if some
(any)
to be predicate
bool:
where the predicate passes
takes a list and a comparator and returns a new list sorted by the comparator.
Type: function (l: List, f: Func): List
(List)
to sort
(any)
comparator
List:
sorted by the comparator
takes a list, an index and an updater, and returns a new list with the value at index updated by the updater.
Type: function (l: List, k: any, f: Func): List
(List)
set value on
(any)
is the key of the value to get
(Func)
to update value on map
List:
copy of list value a k updated by f
takes a map and a key and returns a new map with the entity at the key removed.
Type: function (m: Map, k: any): Map
(Map)
to delete value from
(any)
key to delete the value at
Map:
copy of m without value at k
merges two immutable maps. if the two maps contain a key that is the same, the second maps value will be used
Type: function (m1: Map, m2: Map): Map
Map:
of merged maps
constructs an immutable map from a map like structure.
Type: function (s: (Map | Object)): Map
Map:
immutable map
takes a predicate and uses it to partition the map into a map pair. for each entity if the predicate returns true the entity will be in the first map, else the second.
Type: function (m: Map, f: Func): [Map, Map]
(Map)
map to partition
(Func)
predicate
[Map, Map]:
pair of maps, left true, right false
takes an array of keys and returns an object with the members corresponding to the keys.
Type: function (m: Map, ks: Array<any>): Object
Object:
containing ks with value of map
takes a key and a value and sets the key on the map with the value.
Type: function (m: Map, k: any, v: any): Map
Map:
an updated copy
takes a key and an updater fn. if the key exists on the map the current value the updater fn is called with the value, else with no params. whatever the updater returns is set as the new value on the map for the key.
Type: function (m: Map, k: any, f: Func): Map
Map:
an updated copy
_ is used as a no bind for partial application.
Type: Symbol
identifies if entity is no bind symbol
Type: function (u: any): boolean
(any)
to be identified if is no bind symbol
bool:
whether entity is no bind
takes a function of 1..3 args and returns a curried version
Type: function (f: Func): Func
(Func)
to be curried
Func:
a curried version of f
takes a function of 1 args and returns a curried version
Type: function (f: Func): Func
(Func)
to be curried
Func:
a curried version of f
takes a function of 2 args and returns a curried version
Type: function (f: Func): Func
(Func)
to be curried
Func:
a curried version of f
takes a function of 3 args and returns a curried version
Type: function (f: Func): Func
(Func)
to be curried
Func:
a curried version of f
Type: {}
identifies if u is an immutabled type
Type: isType
(any)
entity to identify if is an immutabled type
bool:
whether the entity is an immutabled type
identifies if u is a list type
Type: isType
(any)
entity to identify if is a list type
bool:
whether the entity is a list type
identifies if u is a map type
Type: isType
(any)
entity to identify if is a map type
bool:
whether the entity is a map type
identifies if u is an array type
Type: isType
(any)
entity to identify if is an array type
bool:
whether the entity is an array type
identifies if u is an object type
Type: isType
(any)
entity to identify if is an object type
bool:
whether the entity is an object type
identifies if u is a primitive type
Type: isType
(any)
entity to identify if is a primitive type
bool:
whether the entity is a primitive type