hkt-toolbelt
Advanced tools
Changelog
[0.24.5]
NaturalNumber.Square
to compute the square of a natural number.Object.AtKey
to get the value at a key in an object. (swapped argument order of Object.At
)Conditional.equals
to perform deep equality.Changelog
[0.24.4]
List
, NaturalNumber
, String
, and Type
.Type.Never
to represent the never
type.Changelog
[0.24.3]
List.IsEmpty
to check if a list is empty.List.Take
to take the first N elements of a list.List.TransformAt
to transform the element at a given index in a list.List.UnshiftValue
to unshift a value onto a list.Kind.LazyPipe
to apply a list of kinds lazily, i.e. allow intermediate currying.Boolean.ToNumber
to convert a boolean to a number, i.e. 1 or 0.List.At
to return the union of all elements in a list if given number
as an index.Changelog
[0.24.1]
List.CountBy
to count the number of elements in a list that satisfy a predicate.Object.Entries
to get the entries of an object.Object.Assign
to assign a value to a key in an object.List.MaxBy
and List.MinBy
to find the maximum or minimum element in a list that satisfies a predicate.Changelog
[0.24.0]
Kind
utilities:
Kind.Juxt
for performing multiple calculations on a single input.Kind.PipeWeak
for a more flexible pipe operation with less checks.List
utilities:
List.Chunk
for chunking lists into specified sizes of sublists.List.Duplicates
to identify duplicate values in a list.List.FlatMap
that maps over a kind and flattens the result one level.List.IncludesValue
as an argument swap of List.Includes
.List.Intersect
to get common elements between two lists.List.PushValue
as an argument swap of List.Push
.List.Remove
to filter out every instance of a value from a list.List.Unique
to return a list with all duplicate elements removed.Loop
module with an initial Loop.Until
utility.Matrix
module for dealing with two-dimensional arrays:
Matrix.Chunk
to chunk a matrix into a list of matrices.Matrix.Columns
to get the columns of a matrix.Matrix.Combine
to combine to merge a matrix of matrices into a single matrix.Matrix.Rows
to get the rows of a matrix.Matrix.Slice
to slice a matrix to get a submatrix using four indices.Type
utilities for intersection and union types:
Type.Intersect
to get the intersection of two types.Type.Union
to get the union of two types.Type.IntersectAll
to get the intersection of all types in a tuple.Type.UnionAll
to get the union of all types in a tuple.Object
utilities for object manipulation.List.Repeat
to match documentation.List.Includes
to take in direct value (since List.Some
already exists).Changelog
[0.23.0]
DigitList._$signedAdd
, for efficient signed addition using digit lists.List.Range
edge case semantics.