[Haskell-beginners] The Data Parallel Haskell example from the
Haskell Wiki won't work
Ben Lippmeier
benl at ouroborus.net
Wed Sep 29 03:27:19 EDT 2010
>> Has someone been able to successfully compile and run this example code?? If so, what am I doing wrong? Is there some obvious error I'm incurring in? :D
>
> It's because you didn't add {-# OPTIONS -fvectorise #-} when compiling the DPHVectMul.hs module. The GHC vectoriser rewrites calls to fromPArrayP to the real implementations in its back-end library, but if the vectoriser doesn't run you get the default implementation which is just "undefined". I agree its an atrocious error message. It should have a real one in the head / GHC 7.0
You can also add -fvectorise on the command line, but I prefer using the OPTIONS pragma because it's less easy to forget.
Ben.
More information about the Beginners
mailing list