[Haskell-cafe] type dependency

Bulat Ziganshin bulat.ziganshin at gmail.com
Mon Jul 10 04:28:18 EDT 2006


Hello Donn,

Monday, July 10, 2006, 11:03:32 AM, you wrote:

>     plot :: GraphIntInt -> [CLLong] -> [CLLong] -> IO ()
>     plot :: GraphIntFloat -> [CLLong] -> [CDouble] -> IO ()
>     plot :: GraphFloatInt -> [CDouble] -> [CLLong] -> IO ()
>     plot :: GraphFloatFloat -> [CDouble] -> [CDouble] -> IO ()

>    class Coords (g x y) where
>       plot :: g -> [x] -> [y] -> IO ()
>    instance Coords (GraphIntInt CLLong CLLong) where
>       ...
>    instance Coords (GraphIntFloat CLLong CDouble) where
>       ...

{-# OPTIONS_GHC -fglasgow-exts #-}
....
class Coords g x y where
   plot :: g -> [x] -> [y] -> IO ()

instance Coords GraphIntInt CLLong CLLong where
   plot = plotIntInt
...


OPTIONS_GHC should be first line of source file (multi-parameter type
classes is one of GHC's extension over H98)


-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Haskell-Cafe mailing list