[Haskell-beginners] special polymorphic default of typeclass depending on other typeclasses?

Silent Leaf silent.leaf0 at gmail.com
Thu Jun 29 17:15:26 UTC 2017


hi,

say i have the following typeclass:

class Foo a where
  bar :: a  -> String

looks a lot like the Read typeclass, right? (at least i think it should?)
well say it's a different meaning (in other terms i can't or do not want to
use Read, but i'd like to implement a default version of bar for those
instances that also implement Read. is there a way to do so?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20170629/a1fa9673/attachment.html>


More information about the Beginners mailing list