Bounds checking bugs: The ghc-compiled program that produces this error reads: import Data.Array.Vector main = print s where s :: UArr Double s = replicateU (-1) 2 ------------------------------------------------------------------------ Direction: * Fill out API * Complete coverage -- ensure we can enumerate all primitives types, and fuse them. * Direct implementation of fusible operations too -- substrings, length in O(1) * concat/concatMap ? (need lifted arrays?) * IO introduction - Data.Binary/bytestring - Array interface? - Binary? * A good strategy for user defined loops (pure, impure) * A good strategy for user defined packing * Organisation: Vector -- stream version Strict -- strict data types and ops Vector.Array -- direct implementation Vector.Mutable -- mutable ops Prim/* Stream/* Mutable: new length read, write copy, stream, unstream * To and from ByteStrings. See the operators in the OCaml library, http://caml.inria.fr/pub/docs/manual-ocaml/libref/Bigarray.Array1.html Beware: * combining modules can break fusion in 6.8.2 Documentation: * State that -O2 is *required* for unboxing of stream state components with SpecConstr otherwise, -O -fspec-constr * Examples of high and low level use * haddocks Performance: * Need performance benchmarks Possibles: * Maybe provide ST interface for low level things? The following are not currently tested because they crash the testsuite, but should be caught and tested: Unsafe functions that allow reading or writing of memory that doesn't belong to the parameters. In square brackets is whether you can read or write memory using the function, and whether the safe mode flag currently prevents this: * replicateEachU: the user can specify allocated length of the output array, but other parameters allow the actual resulting array to be longer [READ?] * replicateEachU 1 (toU [10]) (toU [1]) * zipU, zip3U: the production has length of the first parameter, and many functions on the result (lengthU, for example, will catch mismatched lengths on a UAProd) are unsafe [READ] * zipU (toU [1..10]) (toU [1]) * enumFromToEachU: the user can specify allocated length of the output array, which isn't required to match the length implied by the other parameters [READ] * enumFromToEachU 1 $ toU [(1 :*: 100)] * packU: if the first argument is longer than the second, it will keep reading off the end of the second [READ] * packU (toU [1..100]) (toU [True,False,False,False,True]) * writeMU and friends [WRITE] Functions that crash on unexpected inputs (not because of memory issues): * enumFromStepLenU * enumFromStepLenU 1 0 (-1) -- bus error * enumFromToFracU * enumFromToFracU 1 (-2) -- ghc internal error (requested zero blocks) * sliceU * sliceU (toU [1..10]) 1 (-1) -- segfault