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

Felipe Lessa felipe.lessa at gmail.com
Sat Feb 21 20:05:17 EST 2009


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,

-- 
Felipe.


More information about the Haskell-Cafe mailing list