Faking with type families
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…
Keep reading with a 7-day free trial
Subscribe to Type Classes to keep reading this post and get 7 days of free access to the full post archives.