-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpreface.txt
More file actions
16 lines (8 loc) · 1.66 KB
/
preface.txt
File metadata and controls
16 lines (8 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
This little book will show you an example of using the Test Driven Development technique in the Haskell programming language. Test Driven Development consist in building a program using the three-steps process of writing a test that fails, making it pass, and then refactoring both code and tests. Following the TDD process allows to create programs through emergent design. The book shows a path towards a solution to the "PokerHand" kata (http://codingdojo.org/cgi-bin/wiki.pl?KataPokerHands).
Elements of Haskell covered in the books are: comparison functions, lists functions (grouping, sorting) and creating new data types.
I borrowed the style of the excellent** book The Little Schemer by Daniel P. Friedman and Matthias Felleisen which features two protagonists going through a very simple question/response loop, building a full programming lesson through code examples only. I made two adaptations to this highly pedagogic style: most of the questions include a new unit test, and most of the response are refactorings.
Some advice might help you to enjoy the text:
The colored square indicates the status of the unit test "bar". Green means that all the test pass. Orange means that the test cannot run because the program syntax is currently incorrect, Red means that at least one the unit tests fails.
Be sure to understand a step before continuing reading to the next step.
Use GHCI, the Haskell interactive environment, when you want to know more about the functions that are used through the text.
Each chapter presents the source code written so far. I apologize in advance for the remaining typos and would be grateful for any kind of feedback about this little book.