« My Satisfaction with Git: No Abstraction | Main | The Long Tail of Technical Debt »

April 27, 2012



Michael, thanks for the post!

I'm new to haskell too but I've caught myself recently doing something similiar. https://github.com/zmoazeni/3load/blob/master/src/Strategies.hs#L77 and https://github.com/zmoazeni/karkeze/blob/master/src/Parser.hs#L53

Even when the function signature wasn't necessary, I found it was helpful to clear up mental inconsistencies.

Mark Thomas

Nice post!

Eric Meijer uses similar approach in his series on MSDN: http://channel9.msdn.com/Shows/Going+Deep/Lecture-Series-Erik-Meijer-Functional-Programming-Fundamentals-Chapter-1

I can't remember which chapter it is in though.

Daniel Sobral

Like types, a test is a proof about the program. The main distinction is that tests, as opposed to types, are ad hoc and with very limited scope -- though some times can be very limited in scope as well, when you get to advanced types such as those in Agda or Coq.

So Type-DD and Test-DD are are very similar. Uncle Bob's first is very adamant, for instance, that you should write the smallest test possible that fails, and that not compiling is failing.

In Test Driven Development, the only distinction would be that you'd first write a test to the effect that you have a function called lineBreak that takes a String and returns a String, fail compilation, and then write the declaration.


I like that. Still, your code took as much though (if not more!) and doesn't change anything UncleBob said about estimation. Estimation is still hard, and always will be.
I'd rather maintain the Haskell code though.

Stefan Roock

From the post I don't understand how Type Driven Development relates to TDD. For me it would be helpful to see. the single steps (Screencast, http://CodersDojo.org etc.).


Nice example; Add a requirement for correct hyphenation if wordlength is greater than the line lenght.

Also, it'd be interesting to compare different approaches for solving this as efficiently as possible by using concurrent programming.


But still you didn't test at all while developing?
I'm a novice in Haskell, but I need a lot of tests before nailing down my functions. I'm using GHCi to manually testing them, but for sure I'd like to have a kind of testing framework, probably more like fitnesse than xUnit


I'm glad your saying this. If I had a nickle for everytime I was blasted for even suggesting that these kind of type systems and test driven development had some overlap in facility to aid incremental design, well, then I could probably pay you to say it for me. In short, thanks for blogging about this even though strongly typed functional programmers have been saying this for years.



thanks for the info :)

The comments to this entry are closed.