Type Classes

Type Classes

Share this post

Type Classes
Type Classes
Faking with type families

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.

Chris Martin's avatar
Chris Martin
May 03, 2023
∙ Paid
3

Share this post

Type Classes
Type Classes
Faking with type families
Share

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.

Already a paid subscriber? Sign in
© 2025 Mission Valley Software LLC
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share