Allow type signatures in instance declarations
|Reported by:||kprateek88||Owned by:|
|Operating System:||Unknown/Multiple||Architecture:||x86_64 (amd64)|
|Type of failure:||None/Unknown||Test Case:|
|Related Tickets:||Differential Rev(s):|
GHC should allow type signatures in instance declarations. It should check that they match the type signatures from the class, and reject with an error message if not. This has the following advantages:
- It allows a programmer to assert what he/she thinks is the type signature of the function being defined, and have it checked against what it should be. If the programmer is wrong, this will be immediately apparent with the error message, instead of a potentially obscure type error.
- A programmer can consistently follow the (reasonable) coding style of always writing type signatures for functions, without being hindered by "Misplaced type signature" errors and having to make a special case for instance declarations by commenting out (or removing) the type signature.