#5674: Allow type signatures in instance declarations
---------------------------------+------------------------------------------
Reporter: kprateek88 | Owner:
Type: feature request | Status: new
Priority: normal | Component: Compiler
Version: 7.2.1 | Keywords:
Testcase: | Blockedby:
Os: Unknown/Multiple | Blocking:
Architecture: x86_64 (amd64) | Failure: None/Unknown
---------------------------------+------------------------------------------
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.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5674>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs