symbols

symbols

Type: Symbols

Since: 0.0.1

immut.apply

takes an immutable, a key array, and an updater, and applies the updater function to the entity at the key path.

immut.apply

Type: function (Immut, Array<any>, Func): (Immut | void)

Deprecated: since 0.0.1, to be removed in 0.1.0
Since: 0.0.1
Parameters
i (Immut) to apply f to
ks (Array<any>) of the path to apply to
f (Func) to apply
args (...any)
Returns
Immut: the copy of the immutable with the updated value

immut.data

takes an immutable collection and returns the raw pojo data.

immut.data

Type: function (i: Immut): any

Since: 0.0.1
Parameters
i (Immut) immutable species
Returns
any: a reference to the immut's data

immut.parse

takes a shape template and JSON like and parses it to match the shape.

immut.parse

Type: function (s: (Shape | any), d: any): (Immut | Leaf | void)

Since: 0.0.1
Parameters
s (Object) template of the shape
d (Object) to parse
Returns
(Immut | Leaf | void): the data parsed to match the shape

immut.get

takes an immutable collection and a key and returns the entity from the collection that the key refences.

immut.get

Type: function (i: Immut, k: any): any

Since: 0.0.1
Parameters
i (Immut) immutable species
k (any) of member
Returns
any: an entity from the collection

immut.getIn

takes an immutable, a key array, and returns the member nested at the key

immut.getIn

Type: function (i: Immut, ks: Array<any>): (any | void)

Since: 0.0.10
Parameters
i (Immut) to get nested member in
ks (Array<any>) of the path to get member at
$1 (any)
Name Description
$1.k any
$1.ks ...any
Returns
any: the member at the key path

immut.setIn

takes an immutable, a key array, and a value, and applies the value to the entity at the key path.

immut.setIn

Type: function (i: Immut, ks: Array<any>, v: any): (Immut | void)

Since: 0.0.8
Parameters
i (Immut) to setIn f to
ks (Array<any>) of the path to setIn to
f (Func) to setIn
$1 (any)
Name Description
$1.k any
$1.ks ...any
v (any)
Returns
Immut: the copy of the immutable with the updated value

immut.size

takes an immutable and returns the size of the collection.

immut.size

Type: function (i: Immut): number

Since: 0.0.1
Parameters
i (Immut) to find size of
Returns
number: size of immutable collection

immut.updateIn

takes an immutable, a key array, and an updater, and applies the updater function to the entity at the key path.

immut.updateIn

Type: function (i: Immut, ks: Array<any>, f: Func): (Immut | void)

Since: 0.0.8
Parameters
i (Immut) to updateIn f to
ks (Array<any>) of the path to updateIn to
f (Func) to updateIn
$1 (any)
Name Description
$1.k any
$1.ks ...any
Returns
Immut: the copy of the immutable with the updated value

list.concat

takes two immutable lists and returns a new combined list. list two is concatenated to the end of list one.

list.concat

Type: function (l1: List, l2: List): List

Since: 0.0.1
Parameters
l1 (List) to concat
l2 (any) to be predicate
Returns
List: a new list of combined l1 && l2.

list.del

takes a list and an index and returns a new list with the entity at the index removed.

list.del

Type: function (l: List, i: number): List

Since: 0.0.3
Parameters
l (List) to delete value from
i (number) index to delete the value at
Returns
List: without value at i

list.every

tests all entities against the predicate, until one returns false. if one returns false list.every returns false, else true.

list.every

Type: function (l: List, f: Func): boolean

Since: 0.0.1
Parameters
l (List) to check if every
f (Func) to be predicate
Returns
boolean: if predicate returns true for all entities

list.filter

takes a list and a predicate and returns a new list consisting of the elements which pass the predicate.

list.filter

Type: function (l: List, f: Func): List

Since: 0.0.1
Parameters
l (List) to filter
f (any) to be predicate
Returns
List: of elements that pass the predicate

list.find

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.

list.find

Type: function (l: List, f: Func): (any | null)

Since: 0.0.1
Parameters
l (List) to find item in
f (any) to be predicate
Returns
(any | null): the first item to pass the predicate or null

list.findIndex

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.

list.findIndex

Type: function (l: List, f: Func): number

Since: 0.0.1
Parameters
l (List) to find index in
f (any) to be predicate
Returns
number: the first item to pass the predicate or -1

list.fold

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

list.fold

Type: function (l: List, f: Func, i: any): any

Since: 0.0.1
Parameters
l (List) to fold
f (any) accumulator
i (any) initial accum value
Returns
any: the final value from the accumulator
Example
const accumulator = (acc, n) => acc + n
  const initialVal  = 0
  const aList       = list.of([1, 1, 1])

  list.fold(aList, accumulator, initialVal) // returns 3

list.has

is a predicate for whether an entity exists in a list

list.has

Type: function (l: List, v: any): boolean

Since: 0.0.1
Parameters
l (List) to search in
v (any) to be predicate
Returns
bool: whether an entity exists in the list

list.indexOf

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.

list.indexOf

Type: function (l: List, i: any): number

Since: 0.0.1
Parameters
l (List) to indexOf
i (any) to find index of
Returns
number: the index of the entity or -1

list.map

takes a list and a function and applies the function to each entity in the list returning a list of the updated entities.

list.map

Type: function (l: List, f: Func): List

Since: 0.0.1
Parameters
l (List) to map
f (any) to be mapping function
Returns
List: of the updated entities

list.of

takes a list like type and constructs a new list.

list.of

Type: function (s: (List | Array<any>)): List

Since: 0.0.1
Parameters
s ((Array<any> | List)?= []) of data to build list from
Returns
List:

list.partition

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.

list.partition

Type: function (l: List, f: Func): [List, List]

Since: 0.0.1
Parameters
l (List) to partition
f (Func) predicate
Returns
[List, List]: pair of lists, left true, right false.

list.pop

takes a list and returns a new list minus the last entity

list.pop

Type: function (l: List): List

Since: 0.0.1
Parameters
l (List) push value on
Returns
List: with all values same as list minus the last entity

list.push

takes a list and a value and returns a new list with the value at the end

list.push

Type: function (l: List, v: any): List

Since: 0.0.1
Parameters
l (List) push value on
v (any) to push
Returns
List: a list copy with the value at the end

list.set

takes a list, an index and a value. returns a new list with the value at the index set as the new value.

list.set

Type: function (l: List, k: any, v: any): List

Since: 0.0.1
Parameters
l (List) to set value on
k (any) is the index of the value to get
v (any) to set on list
Returns
List: a new list with the value at k set as v

list.some

tests all entities against the predicate until one returns true. if one returns true list.some returns true else returns false.

list.some

Type: function (l: List, f: Func): boolean

Since: 0.0.1
Parameters
l (List) to check if some
f (any) to be predicate
Returns
bool: where the predicate passes

list.sort

takes a list and a comparator and returns a new list sorted by the comparator.

list.sort

Type: function (l: List, f: Func): List

Since: 0.0.1
Parameters
l (List) to sort
f (any) comparator
Returns
List: sorted by the comparator

list.update

takes a list, an index and an updater, and returns a new list with the value at index updated by the updater.

list.update

Type: function (l: List, k: any, f: Func): List

Since: 0.0.1
Parameters
l (List) set value on
k (any) is the key of the value to get
f (Func) to update value on map
Returns
List: copy of list value a k updated by f

map.del

takes a map and a key and returns a new map with the entity at the key removed.

map.del

Type: function (m: Map, k: any): Map

Since: 0.0.3
Parameters
m (Map) to delete value from
k (any) key to delete the value at
Returns
Map: copy of m without value at k

map.merge

merges two immutable maps. if the two maps contain a key that is the same, the second maps value will be used

map.merge

Type: function (m1: Map, m2: Map): Map

Since: 0.0.1
Parameters
m1 (Map) to merge onto
m2 (Map) to merge with
Returns
Map: of merged maps

map.of

constructs an immutable map from a map like structure.

map.of

Type: function (s: (Map | Object)): Map

Since: 0.0.1
Parameters
s ((Map | Object)?= {}) map like structure
Returns
Map: immutable map

map.partition

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.

map.partition

Type: function (m: Map, f: Func): [Map, Map]

Since: 0.0.1
Parameters
m (Map) map to partition
f (Func) predicate
Returns
[Map, Map]: pair of maps, left true, right false

map.pluck

takes an array of keys and returns an object with the members corresponding to the keys.

map.pluck

Type: function (m: Map, ks: Array<any>): Object

Since: 0.0.1
Parameters
m (Map) to pluck values of
ks (Array) to get values of
Returns
Object: containing ks with value of map

map.set

takes a key and a value and sets the key on the map with the value.

map.set

Type: function (m: Map, k: any, v: any): Map

Since: 0.0.1
Parameters
m (Map) to set value on
k (any) is the key of the value to get
v (any) to set on map
Returns
Map: an updated copy

map.update

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.

map.update

Type: function (m: Map, k: any, f: Func): Map

Since: 0.0.1
Parameters
m (Map) to set value on
k (any) is the key of the value to get
f (Func) to update value on map
Returns
Map: an updated copy

_

_ is used as a no bind for partial application.

_

Type: Symbol

Since: 0.0.1

isNoBind

identifies if entity is no bind symbol

isNoBind

Type: function (u: any): boolean

Since: 0.0.1
Parameters
u (any) to be identified if is no bind symbol
Returns
bool: whether entity is no bind

curry

takes a function of 1..3 args and returns a curried version

curry

Type: function (f: Func): Func

Since: 0.0.1
Parameters
f (Func) to be curried
Returns
Func: a curried version of f

curry1

takes a function of 1 args and returns a curried version

curry1

Type: function (f: Func): Func

Since: 0.0.1
Parameters
f (Func) to be curried
Returns
Func: a curried version of f

curry2

takes a function of 2 args and returns a curried version

curry2

Type: function (f: Func): Func

Since: 0.0.1
Parameters
f (Func) to be curried
Returns
Func: a curried version of f

curry3

takes a function of 3 args and returns a curried version

curry3

Type: function (f: Func): Func

Since: 0.0.1
Parameters
f (Func) to be curried
Returns
Func: a curried version of f

curryn

curryn

Type: {}

Since: 0.0.1

isImmut

identifies if u is an immutabled type

isImmut

Type: isType

Since: 0.0.1
Parameters
u (any) entity to identify if is an immutabled type
Returns
bool: whether the entity is an immutabled type

isList

identifies if u is a list type

isList

Type: isType

Since: 0.0.1
Parameters
u (any) entity to identify if is a list type
Returns
bool: whether the entity is a list type

isMap

identifies if u is a map type

isMap

Type: isType

Since: 0.0.1
Parameters
u (any) entity to identify if is a map type
Returns
bool: whether the entity is a map type

isArray

identifies if u is an array type

isArray

Type: isType

Since: 0.0.1
Parameters
u (any) entity to identify if is an array type
Returns
bool: whether the entity is an array type

isObject

identifies if u is an object type

isObject

Type: isType

Since: 0.0.1
Parameters
u (any) entity to identify if is an object type
Returns
bool: whether the entity is an object type

isPrimitive

identifies if u is a primitive type

isPrimitive

Type: isType

Since: 0.0.1
Parameters
u (any) entity to identify if is a primitive type
Returns
bool: whether the entity is a primitive type