I think it might be more appropriate to move this discussion to haskell-cafe.

On 19 okt 2008, at 17:24, Friedrich wrote:
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.
Well I disagree. But that's another story.

Well, it's definitely not true when you're starting out with Haskell. The thing is: once you start to think in types it does work like this. You just think: what do I need as my input and what's my output. That's what you write down as your type and you're almost done! It's very similar to test-driven development; the point with TDD is not so much about making sure your program is correct: the big win (for me) is that it helps you think about the design of your program. The same holds for types.



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.

No  that's not true. The use implies that. However I'm not advice
resistant and will see if I use types. But IMHO that's should be job
of the environment  to figure out  correctly and most of the time
Haskell does "guess" right. And I surely can ask for the types.

I agree. However, sometimes, when things get really complex, you can't figure out a way to write down the code. That's when it can be handy to start out from the types and slowly work towards the definition.

At first, you'll think that types are there to make your life harder. After a while, you'll start to love them and to be honest: I feel quite uncomfortable programming in an untyped language these days ;).

-chris
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to