4 ms·
> Still, type classes seem to appear less and less elegant as time goes on I think part of the problem is that type classes are so easy to abuse. When you have
by purescript 11y ago
> Still, type classes seem to appear less and less elegant as time goes on
I think part of the problem is that type classes are so easy to abuse. When you have a problem like e.g. monad transformers, where a) you have a lot of boilerplate code which would be irksome if written out by hand, b) you have laws to make sure the generated code is sensible, and c) your types have exactly one such sensible instance, then classes are very nice. Abuses of type classes exist where any of the three above conditions fail to hold IMO, and a scrap-your-typeclasses approach can be very valuable then.