On 2008 Oct 16, at 0:53, leledumbo wrote:
The compiler doesn't know what kind of list you are trying to read,
sort, and print.

So, the type must be specific? Then why it's possible to call the sorting
function with any list?

A function may have a polymorphic type; this allows its actual type to be set by context.

A *program* must have fully determined types, which includes polymorphic functions whose calls provide enough context to determine the actual type at the call site. If there isn't enough information to set a concrete type at the call, type inference fails. This is what you get with strong typing.

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon university    KF8NH


_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to