[Haskell-cafe] Array use breaks when I make it unboxed?

Phil pbeadling at mail2web.com
Sat Feb 21 20:26:10 EST 2009


Thanks for the tip - I got it to work using:

a :: UArray Int Double

.... And so on.


Cheers,

Phil.


On 22/02/2009 01:05, "Felipe Lessa" <felipe.lessa at gmail.com> wrote:

> 2009/2/21 Phil <pbeadling at mail2web.com>:
> 
>> InverseNormal.hs:28:38:
>>     No instance for (IArray a1 Double)
>>       arising from a use of `!' at InverseNormal.hs:28:38-40
>>     Possible fix: add an instance declaration for (IArray a1 Double)
>>     In the first argument of `(*)', namely `c ! 1'
>>     In the first argument of `(+)', namely `c ! 1 * q'
>>     In the first argument of `(*)', namely `(c ! 1 * q + c ! 2)'
> 
> 'a1' here is the type of the key. Try something like
> 
> 
>> a = listArray (1 :: Int,6) [-3.969683028665376e+01, 2.209460984245205e+02,
>>                      -2.759285104469687e+02, 1.383577518672690e+02,
>>                      -3.066479806614716e+01, 2.506628277459239e+00]
> 
> or maybe
> 
>> b :: UArray (Int, Int) Double
>> b = listArray (1,5) [-5.447609879822406e+01, 1.615858368580409e+02,
>>                      -1.556989798598866e+02, 6.680131188771972e+01,
>>                      -1.328068155288572e+01]
> 
> I think this is the problem.
> 
> HTH,



More information about the Haskell-Cafe mailing list