Hello,<br><br>I'm having some trouble with a polymorphic function using another polymorphic function within. A simplified code of what I'm trying to do is as follows:<br><br>main = print $ test 1 8 <br><br>test :: a -> Int -> a<br>
test x n = shift x n<br><br>I get the following compilation error:<br><br>Could not deduce (Data.Bits.Bits a) from the context ()<br> arising from a use of `shift' at test.hs:8:11-19<br> Possible fix:<br> add (Data.Bits.Bits a) to the context of<br>
the type signature for `test'<br> In the expression: shift x n<br> In the definition of `test': test x n = shift x n<br><br><br>shift is defined as "a -> Int -> a"<br><br>What am I doing wrong here?<br>
<br>Thanks,<br>Weiyuan<br>