[Haskell-cafe] Language extensions

Andrew Coppin andrewcoppin at btinternet.com
Tue May 29 17:01:02 EDT 2007


Tim Chevalier wrote:
> On 5/29/07, Andrew Coppin <andrewcoppin at btinternet.com> wrote:
>> My point is for most programs, trying to figure out exactly what you
>> want the program to do is going to be much harder than implementing a
>> program that does it.
>
> Writing a spec can help with figuring out what you want your program 
> to do.

True in principle. But if writing the spec is harder than writing the 
actual program, all it means is you spend longer trying to figure out 
how to express intuitively simple concepts using advanced and very 
abstract and subtle predicate calculus.

>>
>> Also, for most programs the spec is far more complicated (and hence
>> prone to error) than the actual program, so...
>
> Really? That might be a good sign that there's something wrong with
> the spec, the program, or your understanding of the problem. In
> Haskell, the most common form of specification is probably type
> signatures. Those are usually simpler than the corresponding
> implementations.

One of the things I love about Haskell is the way the type signature 
alone "almost" tells you what the function actually does. I've never 
come across this in any other language - but then, I've never seen any 
other language with a type system as powerful as Haskell.

OTOH, how many function can you write with :: [Int] -> Int? I can think 
of a few...



More information about the Haskell-Cafe mailing list