Dear Haskellers,
I am using multi parameter typeclasses to represent images consisting of
pixels (e.g. bitmap images).
{-# OPTIONS_GHC -XMultiParamTypeClasses #-}
module Bitmap where
-- | a pixel could be a Word8 (e.g. a graysclale image)
-- | or a 3-tuple for RGB images
class
However, I do not really understand the cause of the original problem. Why
do I need the functional dependency to make this work ?
Suppose you have an instance:
instance Pixel MyPixel where...
instance Image MyImage MyPixel where
width i = countPixels i
...
And somebody (not necessarily yo
Hello Harald,
Monday, August 24, 2009, 3:17:28 PM, you wrote:
> class Pixel p where
> -- | an image could be a UArray or a list of lists of pixels
> class Pixel p => Image a p where
read http://haskell.org/haskellwiki/OOP_vs_type_classes
here you say that Image is a particular