My code as follows:
calcstep ::Integral a => a -> acalcstep n = calcstep2 n 0calcstep2 :: Integral (Integral a, Integral b) => a -> b -> acalcstep2 1 k = kcalcstep2 n k | odd n = calcstep2 (n/2) (k+1) | otherwise = calcstep2 (n*3+1) (k+1)
The error is as follows:
Non type-variable argument
in the constraint: Integral (Integral a, Integral b)
(Use -XFlexibleContexts to permit this)
In the type signature for `calcstep2': calcstep2 :: Integral (Integral a, Integral b) => a -> b -> a
Failed, modules loaded: none.
What does it mean? how can I fix it?