[Haskell-cafe] [Newbie] Cannot derive Eq and Show. Why?

Peter Arrenbrecht peter.arrenbrecht at gmail.com
Fri Sep 8 10:03:36 EDT 2006


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.html#a6209518
Sent from the Haskell - Haskell-Cafe forum at Nabble.com.



More information about the Haskell-Cafe mailing list