[GHC] #8447: A combination of type-level comparison and subtraction does not work for 0

GHC ghc-devs at haskell.org
Tue Oct 15 06:19:42 UTC 2013


#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     |           Version:  7.6.3
  checker)                           |  Operating System:  Linux
       Keywords:                     |   Type of failure:  GHC rejects
   Architecture:  Unknown/Multiple   |  valid program
     Difficulty:  Unknown            |         Test Case:
     Blocked By:                     |          Blocking:
Related Tickets:                     |
-------------------------------------+-------------------------------------
 The following function on type level naturals

 {{{
   Diff x y = If (x <=? y) (y-x) (x-y)
 }}}

 does not work when either x or y is 0.

 https://github.com/nushio3/practice/blob/ea8a1716b1d6221ce32d77432b6de3f38e653a27
 /type-nats/int-bug.hs


 I've tested this code on ghc 7.7.20130926 since I couldn't build the
 really latest ghc. I'm sorry if it is already fixed on the ghc head.

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


More information about the ghc-tickets mailing list