nikita-volkov/typeclasses/1.5.0

NOTE: the latest version is 1.8.0

Typeclasses.Extensions.Array

Extensions to the array API, which utilise typeclasses.

fold : Monoid a -> Array a -> a

O(n). Combine the elements of array using a Monoid instance.

foldMap : Monoid b -> (a -> b) -> Array a -> b

O(n). Map each element of the array to a type which has an instance of Monoid, and combine the results.

member : Equality a -> a -> Array a -> Bool

O(n). Check whether a value is a member of an array based on the value's Equality instance.