[GHC] #317: Simplifier doesn't preserve bottoms sometimes

GHC trac at galois.com
Thu Oct 19 19:54:46 EDT 2006


#317: Simplifier doesn't preserve bottoms sometimes
----------------------+-----------------------------------------------------
 Reporter:  simonmar  |          Owner:  simonpj 
     Type:  bug       |         Status:  assigned
 Priority:  low       |      Milestone:  6.8     
Component:  Compiler  |        Version:  6.4     
 Severity:  normal    |     Resolution:  None    
 Keywords:            |     Difficulty:  Unknown 
 Testcase:            |   Architecture:  Unknown 
       Os:  Unknown   |  
----------------------+-----------------------------------------------------
Comment (by int-e at gmx.de):

 In ghc 6.5, and presumably 6.6 (untested), something funny happens if you
 use a bang pattern in {{{stops}}}, like this:
 {{{
 import GHC.Exts

 main = print test2

 test2  :: Bool
 test2   = stops (bot ())
   where
   stops :: Int# -> Bool
   stops !_ = True

 bot :: () -> Int#
 bot () = bot ()
 }}}
 The resulting program terminates, printing a newline and nothing else. I'm
 not sure if bang patterns should work at all on unboxed types, but this
 behaviour is surprising.

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


More information about the Glasgow-haskell-bugs mailing list