Module

Data.Algebra.Array

Package
purescript-data-algebrae
Repository
i-am-tom/purescript-data-algebrae

#Update Source

data Update value

An update algebra for incremental modification.

Constructors

Instances

#filter Source

filter :: forall anything value. (value -> Boolean) -> Array value -> Array (Update anything)

Given an array and a predicate, produce the set of DeleteAt operations to filter the array.

#sortBy Source

sortBy :: forall anything value. (value -> value -> Ordering) -> Array value -> Array (Update anything)

Given an array, and a comparison function, produce the set of incremental operations required to sort the array.

#sortWith Source

sortWith :: forall anything orderer value. Ord orderer => (value -> orderer) -> Array value -> Array (Update anything)

Given an array, and an Ord-type-yielding function, produce the array of incremental operations required to sort the array using that function.

#sort Source

sort :: forall anything value. Ord value => Array value -> Array (Update anything)

Given an array of orderable elements, produce the array of incremental operations to sort them.

#interpret Source

interpret :: forall value. Array value -> Array (Update value) -> Maybe (Array value)

Perform a set of incremental updates on an array, maybe returning a result.