[GHC] #12787: Weird type constraint with undecidable instances

GHC ghc-devs at haskell.org
Mon Oct 31 12:33:15 UTC 2016


#12787: Weird type constraint with undecidable instances
-------------------------------------+-------------------------------------
        Reporter:  nome              |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.0.1
  checker)                           |             Keywords:
      Resolution:                    |  UndecidableInstances
Operating System:  Linux             |         Architecture:  x86_64
 Type of failure:  GHC rejects       |  (amd64)
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by goldfire):

 This looks like correct behavior to me. There is one, universal instance
 of `PartialOrd`. As soon as GHC needs the `PartialOrd` constraint to
 accept the use of `tryCompare`, it will find this instance. But the
 instance context requires an instance for `TotalOrd`, which does not
 exist.

 How would you expect this to be accepted?

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


More information about the ghc-tickets mailing list