[Haskell-cafe] Data declaration vs type classes

Imants Cekusins imantc at gmail.com
Fri Jan 8 11:26:45 UTC 2016


> 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.


More information about the Haskell-Cafe mailing list