Clark Gaebel <cgae...@csclub.uwaterloo.ca> writes: > In Haskell, what's the canonical way of declaring a top-level array > (Data.Vector of a huge list of doubles, in my case)? Performance is > key in my case. > > The straightforward way would just be something like: > > globalArray :: V.Vector Double > globalArray = V.fromList [ huge list of doubles ] > {-# NOINLINE globalArray #-} > > However, I don't want to have to run the fromList at runtime.
I think GHC will convert it to an array (and in general evaluate constants) at compile time (probably requires -O). -k _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe