Serializing with Type Classes
Using Show and Read in our prototype certainly made things easier on us when we were serializing and deserializing things, but that wasn’t the only benefit. It also meant that we didn’t have to think much about how users would interact with our library. Show and Read are both common type classes that have implementations for most basic types, and our users might already have them implemented for their own data.
Now that we’re going to be dropping these type classes in favor of something that works more reliably for our problem, we are going to need to ensure that we’re still giving users the ability to interact with our library using whatever types they happen to be using to represent their own file data. We’ll ...
Get Effective Haskell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.