<div dir="ltr">Hello folks,<br><br>Im kinda new to haskell. Ive only been fiddling around with it for bout 3 - 4 weeks now.<br>And for the life of me... i cant seem to figure out why this doesnt work :<br><br><br>class Foo a where<br>
fooFunc :: a -> Int<br><br>data FooData = FData<br><br>instance Foo FooData where<br> fooFunc _ = 10<br><br><br><br>class Bar a where<br> barFunc :: (Foo b) => a -> b -> Int<br><br>data BarData = BData<br>
<br>instance Bar BarData where<br> barFunc _ FData = 20<br><br><br><br>When I compile I get this :<br> Couldn't match expected type `b' against inferred type `FooData'<br> `b' is a rigid type variable bound by<br>
the type signature for `barFunc' at Sample.hs:16:20<br> In the pattern: FData<br> In the definition of `barFunc': barFunc _ FData = 20<br> In the definition for method `barFunc'<br><br><br>Think Im missing something really big...<br>
Could somebody kindly help me out here...<br><br><br><br>Regards<br>Arun<br><br><br>Could so<br><br><br></div>