Alternative "field-like" superclass syntax
This idea swirls around my head from time to time, so I figured I would write it down.
Motivation
The current superclass notation, piggy-backing on the notation instance constraints, is misleading. The issue is that instance constraints really are inputs, but superclass constraints are actually outputs when using the class, and just inputs when building an instance for it. Or, since we are talking about constraint types themselves, not their (canonical) inhabitants, super classes are things you project, not domains of some sort of function type.
Worse, with Dependent Haskell, we could well need constraints in the Kind of the class, e.g. if a ("promoted") class member is then used in the rest of the kind (dependent constraint). Those goes backs to the debates on "constrained type families", "dataype contexts", and other things I should link (TODO) but would be tedious to rehash.
Proposal
class Foo a where
instance Bar a
instead of
class Bar a => Foo a where