MArray -opengl

module Data.Array.MArray
array Data.Array.MArray
An overloaded interface to mutable arrays. For array types which can be used with this interface, see Data.Array.IO, Data.Array.ST, and Data.Array.Storable.
class Monad m => MArray a e m
array Data.Array.MArray, array Data.Array.MArray.Safe
Class of mutable array types. An array type has the form (a i e) array type constructor (kind * -> * -> *), i is the index type (a member of the class Ix), and e is the element type. The MArray class is parameterised over both a and e (so that instances specialised to certain element types can be defined, in the same way as for IArray), and also over the type of the monad, m, in which the mutable array will be manipulated.
data MArray s
text Data.Text.Array
Mutable array type, for use in the ST monad.
accumArray :: (IArray a e, Ix i) => (e -> e' -> e) -> e -> (i, i) -> [(i, e')] -> a i e
array Data.Array.IArray
Constructs an immutable array from a list of associations. Unlike array, the same index is allowed to occur multiple times in the list of associations; an accumulating function is used to combine the values of elements with the same index. For example, given a list of values of some index type, hist produces a histogram of the number of occurrences of each index within a specified range: > hist :: (Ix a, Num b) => (a,a) -> [a] -> Array a b > hist bnds is = accumArray (+) 0 bnds [(i, 1) | i\<-is, inRange bnds i]
accumArray :: Ix i => (e -> a -> e) -> e -> (i, i) -> [(i, a)] -> Array i e
array Data.Array
The accumArray function deals with repeated indices in the association list using an accumulating function which combines the values of associations with the same index. For example, given a list of values of some index type, hist produces a histogram of the number of occurrences of each index within a specified range: > hist :: (Ix a, Num b) => (a,a) -> [a] -> Array a b > hist bnds is = accumArray (+) 0 bnds [(i, 1) | i<-is, inRange bnds i] If the accumulating function is strict, then accumArray is strict in the values, as well as the indices, in the association list. Thus, unlike ordinary arrays built with array, accumulated arrays should not in general be recursive.