
12 Mar
2012
12 Mar
'12
10:42 a.m.
Is there any proof of this? I'm not familiar enough with core to check.
On Mon, Mar 12, 2012 at 3:48 AM, Ketil Malde
Clark Gaebel
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