Hi,<br><br>class Processor a where<br> ready :: (forall b c. a $B"*(B [b $B"*(B c])<br><br>{-<br>instance Processor (b $B"*(B c) where<br> ready = repeat<br><br>instance Processor [b $B"*(B c] where<br> ready = id-}<br><br>doSth :: (Show p, Processor p) $B"M(B p $B"*(B IO ()<br>
doSth p = print p<br><br>-------------------------------<br>Why can I not declare the above instances and always get:<br><br>message.hs:229:10:<br> Couldn't match expected type `b' against inferred type `b1'<br>
`b' is a rigid type variable bound by<br> the instance declaration at message.hs:228:20<br> `b1' is a rigid type variable bound by<br> the type signature for `ready' at message.hs:226:19<br>
Expected type: b -> c<br> Inferred type: b1 -> c1<br> In the expression: repeat<br> In the definition of `ready': ready = repeat<br><br>message.hs:229:10:<br> Couldn't match expected type `c' against inferred type `c1'<br>
`c' is a rigid type variable bound by<br> the instance declaration at message.hs:228:24<br> `c1' is a rigid type variable bound by<br> the type signature for `ready' at message.hs:226:21<br>
Expected type: b -> c<br> Inferred type: b1 -> c1<br> In the expression: repeat<br> In the definition of `ready': ready = repeat<br><br>message.hs:232:10:<br> Couldn't match expected type `b1' against inferred type `b'<br>
`b1' is a rigid type variable bound by<br> the type signature for `ready' at message.hs:226:19<br> `b' is a rigid type variable bound by<br> the instance declaration at message.hs:231:20<br>
Expected type: [b1 -> c]<br> Inferred type: [b -> c1]<br> In the expression: id<br> In the definition of `ready': ready = id<br><br>message.hs:232:10:<br> Couldn't match expected type `c1' against inferred type `c'<br>
`c1' is a rigid type variable bound by<br> the type signature for `ready' at message.hs:226:21<br> `c' is a rigid type variable bound by<br> the instance declaration at message.hs:231:24<br>
Expected type: [b -> c1]<br> Inferred type: [b1 -> c]<br> In the expression: id<br> In the definition of `ready': ready = id<br><br>Is there a way around this?<br><br>Regards,<br>CS<br>