Take the tour ×  Apparently it's a bad idea to put a typeclass
constraint on a data declaration [src], [src].  I haven't
personally come across a desire to constrain the types within
data types I've created, but it's not obvious to me why the
language designers "decided it was a bad idea to allow". Why is
that?  share|improve this question add comment  2 Answers  up
vote 10 down vote accepted   Because it was misleading and
worked completely backwards from what would actually be useful.
In particular, it didn't actually constrain the types within the
data type in the way you're probably expecting. What it did do
was put a class constraint on the data constructor itself, which
meant that you needed to satisfy the instance when constructing
a value... but that was all.  So, for instance, you couldn't
simply define a binary search tree with an Ord constraint and
then know that any tree has sortable elements; the lookup and
insert functions would still need an Ord constraint themselves.
All you'd prevent would b