|
Data.Array.Vector.Algorithms.Combinators | Portability | Non-portable (rank-2 types) | Stability | Experimental | Maintainer | Dan Doel <dan.doel@gmail.com> |
|
|
|
Description |
The purpose of this module is to supply various combinators for commonly
used idioms for the algorithms in this package. Examples at the time of
this writing include running an algorithm keyed on some function of the
elements (but only computing said function once per element), and safely
applying the algorithms on mutable arrays to immutable arrays.
|
|
Synopsis |
|
|
|
Documentation |
|
|
Safely applies a mutable array algorithm to an immutable array.
|
|
|
Uses a function to compute a key for each element which the
algorithm should use in lieu of the actual element. For instance:
usingKeys sortBy f arr
should produce the same results as:
sortBy (comparing f) arr
the difference being that usingKeys computes each key only once
which can be more efficient for expensive key functions.
|
|
|
As usingKeys, only the key function has access to the array index
at which each element is stored.
|
|
Produced by Haddock version 2.4.2 |