On 2008 May 9, at 8:28, Abhay Parvate wrote:

Of course in the final code many people would recommend that you put in the type declarations as a good form of documentation, and it may be also more specialized according to your usage than what the compiler/interpreter will deduce.


It's also useful to include them because it helps localize other type errors; if you leave type inference to the compiler, a type error will be reported when it is discovered, which may be far from where the actual error is. You end up having to trace back through the definitions of functions used in the failing expression to find where the actual type error is.

--
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 mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to