On Thu, 12 Jan 2006 [EMAIL PROTECTED] wrote:

What does the Haskell type system do with expressions such as these . . .
?
  show 1
  show (1+2)

The type of the subexpressions "1" and "1+2" are "ambiguous" since they
have type "(Num a) => a".  I'm under the assumption before "1+2" is
evaluated, the "1" and "2" must be coerced into a "concrete" type such as
Int, Integer, Double, etc, and before "show 1" is evaluated, the "1" must
be coerced into a "concrete" type.  Is my assumption correct?

Yep. If you start ghc with -Wall option then it also tells you that some automatism is invoked.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to