[Haskell] [Haskell-cafe] Help with polymorphic functions
Brandon S. Allbery KF8NH
allbery at ece.cmu.edu
Fri May 9 08:35:55 EDT 2008
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] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university KF8NH
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell/attachments/20080509/feb71b29/attachment-0001.htm
More information about the Haskell
mailing list