[Haskell] Probably a trivial thing for people knowing Haskell

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Sun Oct 19 10:42:31 EDT 2008


On 2008 Oct 19, at 2:26, Friedrich wrote:
> Paul Johnson <paul at cogito.org.uk> writes:
>>> (By the way, putting in the top level type declarations helps a lot
>> when you make a mistake.)
> Well I have my problems with that. Probably it comes from using
> Languages like Ruby and my special dislike of "typing things" comes
> especially from Java, C++ (well C is not "innocent" in that regard
> also.

Learn to love types:  one of the neat things about Haskell is that if  
you can write down the type of a function then you have usually done  
90% of the work of writing the code for it.  Another is that in  
general, if you can't express the type of a function, it means you  
haven't thought through what you're trying to do.  The relationship  
between types and proofs is especially obvious in Haskell.  And proofs  
aren't merely mathematical entities, they're expressions of what you  
want to accomplish:  if you can type your program, you have a high  
likelihood not only that it will compile, but that it will do what you  
intend.

-- 
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




More information about the Haskell mailing list