[Haskell-beginners] Explicit specification of function types

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Tue Mar 24 00:28:17 EDT 2009


On 2009 Mar 24, at 0:21, Michael Mossey wrote:
> I'm a beginner just learning about type inference (through getting  
> lots of error messages and using :t a lot). I find it fascinating,  
> and it seems a shame to disregard this power by declaring all types.  
> However I realize that it's the more global or critical types that  
> should be declared, and more local areas can be left to inference.  
> Perhaps also the compiler's ability to infer is related to its  
> ability to detect compile-time type errors. In other words, if you  
> program a compiler to be sensitive enough to detect all type errors  
> at compile time, then by necessity you are giving it the smarts to  
> infer types. Is that right?


It may have the knowledge but not the mechanism (consider C++).

-- 
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 --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
Url : http://www.haskell.org/pipermail/beginners/attachments/20090324/857a507d/PGP.bin


More information about the Beginners mailing list