[Haskell-cafe] Query regarding Type classes
Andrew Coppin
andrewcoppin at btinternet.com
Mon Oct 13 13:31:36 EDT 2008
Arun Suresh wrote:
> Hello folks,
>
> Im kinda new to haskell. Ive only been fiddling around with it for
> bout 3 - 4 weeks now.
> And for the life of me... i cant seem to figure out why this doesnt work :
>
>
> class Foo a where
> fooFunc :: a -> Int
>
> data FooData = FData
>
> instance Foo FooData where
> fooFunc _ = 10
>
>
>
> class Bar a where
> barFunc :: (Foo b) => a -> b -> Int
>
> data BarData = BData
>
> instance Bar BarData where
> barFunc _ FData = 20
Ooo, ooo, I know this one, it's... oh, wait, I've been at work all day,
so by now 30 other people have already replied. Heh. I need to find
another day job... ;-)
More information about the Haskell-Cafe
mailing list