[Haskell-cafe] STArray newListArray

Vojtěch Knyttl knyttv at gmail.com
Sun Feb 21 10:30:00 EST 2010


I am trying to create STArray with newListArray like this:
la x y = newListArray ((1,1),(x,y)) [(x'+y') | x' <- [1..x], y' <- [1..y]]

– but it does not work:
No instance for (MArray a Field m)

I tried to define the type like this, but it would not work either:
la :: Int -> Int -> STArray (Int,Int) Field

It is obvious that I don't get the syntax of using it, so I will appreciate any suggestions.

V. K.

More information about the Haskell-Cafe mailing list