Can I have a constrained variable in a type definition?

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)

1 Like