#5248: Infer type context in a type signature
----------------------------------------+-----------------------------------
Reporter: gidyn | Owner:
Type: feature request | Status: new
Priority: normal | Milestone:
Component: Compiler (Type checker) | Version: 7.0.3
Keywords: | Testcase:
Blockedby: | Difficulty:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: GHC rejects valid
program
----------------------------------------+-----------------------------------
Comment(by gidyn):
I'm not sure what you mean by "that's the way Haskell is"; many GHC
features go beyond the Haskell standard.
Perhaps I misworded the ticket, as I wasn't referring to inferring type
contexts from a method's implementation. The type context given in a data-
type's definition should be available wherever the data type is used, so
the (...) => syntax shouldn't be necessary for this case.
To put the issue differently: A type variable in a data/type constructor
is restricted to a given type class. Currently, this restriction has to be
repeated in the signature of every function that uses the restriction.
This repetition is superfluous noise, which is required by the compiler,
but adds no information.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5248#comment:2>
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