Is it proper/ok to defines them as :
fromIntegral :: (a::Integral) -> (b::Num)
and
round :: (a::RealFrac) -> (b::Integral) ?
No; Integral, Num and RealFrac are type classes, not types. Think of a type
class as a "set of types" which all support certain operations. For
example, anything in the Num class must implement +, -, *, and a few other
things. So a type signature like (Integral a) => a means "any type a, as
long as it is in the type class Integral".
Is RealFrac is-a Num ?
Yes, any type which is in the RealFrac type class must also be in the Num
type class.
Does the order matters in (Num b,Integral a) => a -> b or
(Integral a,Num b) => a -> b
No, the order of type class constraints doesn't matter.
With your encouragements, I'll keep pluuging. Thanks.
Good luck!
-Brent
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe