Posts tagged type classes

Better IO testing through Monads

:: haskell, monads, type classes, testing

Unit Testing is a great way to try to verify consistent functionality over the life of our code. Typically we design our tests to cover ranges and edge cases of our code making sure that we can handle all inputs. This is made easy when we write in Functional Languages as there (should be) no side effects. But when you want to deal with IO and side affect code in Haskell, this becomes much more difficult.

This problem has been fixed many times, but often with very complex solutions. Let’s see if we can make it really simple (even if the post is long).