[GHC] #11099: Incorrect warning about redundant constraints

GHC ghc-devs at haskell.org
Wed Nov 18 17:15:33 UTC 2015


#11099: Incorrect warning about redundant constraints
-------------------------------------+-------------------------------------
        Reporter:  diatchki          |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  7.11
  checker)                           |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by diatchki):

 I don't see how it is redundant---without that constraint I couldn't write
 the required type for the function: notice that the constraint is used to
 compute the type of the output from the type of the input.

 If I was to remove the constraint, then the connection between the input
 and output type is lost, and so uses of this function would become
 ambiguous in some contexts.

 In other situations (e.g., the function `get`
 [wiki:Proposal/CustomTypeErrors#ExtendedExample here]) this would be not
 just ambiguous but also plain wrong.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11099#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list