3 ms·
The interfaces are defined at the modules Text.Read and Data.Monoid, in the standard library. You just take the interface there and implement it. For example, t
by marcosdumay 9y ago
The interfaces are defined at the modules Text.Read and Data.Monoid, in the standard library. You just take the interface there and implement it. For example, the Maybe instance of Monoid is something like:
instance Monoid Maybe where
mempty = Nothing
mappend Nothing b = b
mappend a _ = a
Read is bit hard to implement. But it's also not something out of this world.