A pull array is an array from which it is easy to extract elements, and this can be done in any order. The linear consumption of a pull array means each element is consumed exactly once, but the length can be accessed freely.
Modulelinear-base-0.4.0Haskell2010
Data.Array.Polarized.Pull
This module provides pull arrays.
These are part of a larger framework for controlling when memory is
allocated for an array. See Data.Array.Polarized.
- 1 type
- 15 values
- Packagelinear-base-0.4.0
- Exports16
- LanguageHaskell2010
- LicenceMIT
- SourcePull.hs
Construction
4 declarationsfromFunction arrIndexer len constructs a pull array given a function
arrIndexer that goes from an array index to array values and a specified
length len.
Convert a Vector to a pull array.
Creates a pull array of given size, filled with the given element.
Produce a pull array of lenght 1 consisting of solely the given element.
Consumption
2 declarationsThis is a convenience function for alloc . transfer
Convert a pull array into a list.
Operations
9 declarationszip [x1, ..., xn] [y1, ..., yn] = [(x1,y1), ..., (xn,yn)]
Partial: `zip [x1,x2,...,xn] [y1,y2,...,yp]` is an error if n ≠ p.
zipWith f [x1,x2,...,xn] [y1,y2,...,yn] = [f x1 y1, ..., f xn yn]
Partial: `zipWith f [x1,x2,...,xn] [y1,y2,...,yp]` is an error
if n ≠ p.
Concatenate two pull arrays.
A right-fold of a pull array.
Fold a pull array using a monoid.
Extract the length of an array, and give back the original array.
Reverse a pull array.
Index a pull array (without checking bounds)