
8 Jan
2016
8 Jan
'16
6:29 a.m.
On 8 January 2016 at 12:26, Imants Cekusins
it's very hard to pass them around, manipulate them and compute with them without using non-standard and awkward techniques.
well here is one simple use case when class is very convenient:
class ConvertByteString a where toByteString::a -> ByteString fromByteString::ByteString -> a
no problems defining instances of this class, passing and calling them whatsoever.
One problem with this class would be if you convert String or Text: what encoding would you use? Probably UTF8, but there are others, and if you need those you need a newtype at least. Erik