[Newbie] Cannot derive Eq and Show. Why?

Hi all I am stumped again. The following code generates the error "ERROR file:.\Cube.hs:12 - An instance of IArray UArray a is required to derive Eq (Cube a b)" in Hugs. But I did specify the IArray UArray k constraint. So what is wrong? module Cube( Cube(..) ) where import Data.Array.Unboxed data (Ord k, IArray UArray k, IArray UArray v) => Cube k v = Empty | Values (UArray Int k) (UArray Int v) | Subs (UArray Int k) (Array Int (Cube k v)) deriving (Show, Eq) Thanks for any help -peo -- View this message in context: http://www.nabble.com/-Newbie--Cannot-derive-Eq-and-Show.-Why--tf2239265.htm... Sent from the Haskell - Haskell-Cafe forum at Nabble.com.

Hello Peter, Friday, September 8, 2006, 6:03:36 PM, you wrote:
I am stumped again. The following code generates the error "ERROR file:.\Cube.hs:12 - An instance of IArray UArray a is required to derive Eq (Cube a b)" in Hugs. But I did specify the IArray UArray k constraint. So what is wrong?
data (Ord k, IArray UArray k, IArray UArray v) =>
shortly speaking, you should either use boxed Array or switch to using my ArrayRef library which supports polymorphic unboxed arrays look for detailed explanations of problem to http://www.haskell.org/pipermail/haskell-cafe/2004-July/006400.html ArrayRef library can be found at http://haskell.org/haskellwiki/Library/ArrayRef for use with Hugs it need to be preprocessed via one of included MakeHugs scripts i have added your module to the library as the shortest example of using polymorphic unboxed arrays :) see attached file. of course, if you want that this file will be removed or modified, i will do -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com
participants (2)
-
Bulat Ziganshin
-
Peter Arrenbrecht