Can I have a constrained variable in a type definition?


#1

Instead of data T a = T a, I want something like data T (Eq <= a) = T a which would allow me to write derive instance eqT :: Eq T

ANSWER (by kritzcreek)
write derive instance eqT :: Eq a => Eq (T a) instead

(Cross-posted from Slack: https://functionalprogramming.slack.com/archives/C717K38CE/p1528488137000554)