
#8447: A combination of type-level comparison and subtraction does not work for 0 ----------------------------------------------+---------------------------- Reporter: nushio | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Compiler (Type checker) | Version: 7.6.3 Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: GHC rejects valid program | Unknown/Multiple Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: ----------------------------------------------+---------------------------- Comment (by diatchki): Hello, the issue here is that type functions are kind of strict at the moment, so we evaluate both branched of the `If` are checked, and then we have some code that spots the one is impossible. GHC used to reason like this: 0 - 5 ~ r --> 5 + r ~ 0 --> (5 ~ 0, r ~ 0) --> Impossible For the time being I've weakened things a bit, so this does not happen anymore. However, we should probably try to think of a more general solution because we really want GHC to be good at reasoning, rather than bad! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8447#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler