Re: InstanceSigs -- rationale for the "must be more polymorphic than"

2021-08-08 Thread David Feuer
To the best of my knowledge, `InstanceSigs` are never strictly necessary. They can, however, be useful for at least four purposes: 1. To provide a compiler-checked reminder of the type. 2. To bind type variables with `ScopedTypeVariables`. 3. To generalize the type so you can use polymorphic

InstanceSigs -- rationale for the "must be more polymorphic than"

2021-08-08 Thread Anthony Clayden
I can't help but feel InstanceSigs are either superfluous or upside-down. It's this bit in the User Guide: > The type signature in the instance declaration must be > more polymorphic than (or the same as) the one in the class declaration, > instantiated with the instance type. Usually if you