Hello,

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:

main = print $ test 1 8

test :: a -> Int -> a
test x n = shift x n

I get the following compilation error:

Could not deduce (Data.Bits.Bits a) from the context ()
      arising from a use of `shift' at test.hs:8:11-19
    Possible fix:
      add (Data.Bits.Bits a) to the context of
        the type signature for `test'
    In the expression: shift x n
    In the definition of `test': test x n = shift x n


shift is defined as "a -> Int -> a"

What am I doing wrong here?

Thanks,
Weiyuan
_______________________________________________
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to