Hello,<br><br>I&#39;m having some trouble with a polymorphic function using another polymorphic function within. A simplified code of what I&#39;m trying to do is as follows:<br><br>main = print $ test 1 8 <br><br>test :: a -&gt; Int -&gt; 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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; arising from a use of `shift&#39; at test.hs:8:11-19<br>&nbsp;&nbsp;&nbsp; Possible fix:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add (Data.Bits.Bits a) to the context of<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the type signature for `test&#39;<br>&nbsp;&nbsp;&nbsp; In the expression: shift x n<br>&nbsp;&nbsp;&nbsp; In the definition of `test&#39;: test x n = shift x n<br><br><br>shift is defined as &quot;a -&gt; Int -&gt; a&quot;<br><br>What am I doing wrong here?<br>
<br>Thanks,<br>Weiyuan<br>