Type families give us great power to work polymorphically. In conjunction with "fake" instances, this can make it possible to test code that seemed untestable.
My example this week expands upon testability and the notion of “seams” borrowed from Working Effectively with Legacy Code. I ended the Working with Legacy Haskell article by hinting that because Haskell’s approach to polymorphism is more general than that of Java or C++, we have more substantial ability to create places in our code where a test suite c…
