Haskell is an absolute pleasure to write code in, and I've been trying to use it more and more. It's a language that rewards extended effort in a way that
C++ et. al. do not.
The code is straightforward (as Haskell code tends to be) - we define our basic tree structure, describe some type classes it belongs to, and traverse the tree.
Assume there was a bug in our code - for example, we replace an
|| with an
&& in our
search function, going from
Running this incorrect program, QuickCheck immediately identifies the minimal example for which this program fails.