[GHC] #14686: -XStrict language extension makes behavior change

GHC ghc-devs at haskell.org
Fri Jan 19 07:46:32 UTC 2018


#14686: -XStrict language extension makes behavior change
-------------------------------------+-------------------------------------
           Reporter:  jeiea          |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.2.2
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 In the below code without language pragma it prints 0, and it is expected.

 With language pragma, it doesn't terminate. I don't know whether it is
 intended to evaluate unnecessary where term and why it doesn't terminate.

 {{{
 {-# LANGUAGE Strict #-}

 shouldBe0 :: Int -> Int
 shouldBe0 l = if l <= 0 then l else shouldBe0 (l - 1)
   where res = shouldBe0 (l - 1)

 main :: IO ()
 main = print $ shouldBe0 1
 }}}

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


More information about the ghc-tickets mailing list