[GHC] #16329: Simplifier ticks exhausted when fusioning list literals

GHC ghc-devs at haskell.org
Sat Feb 16 10:41:39 UTC 2019


#16329: Simplifier ticks exhausted when fusioning list literals
-------------------------------------+-------------------------------------
        Reporter:  autotaker         |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.6.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by autotaker):

 A simpler example is found.

 {{{#!hs
 module Main10S(func) where

 foldM :: (Monad m) => (b -> a -> m b) -> b -> [a] -> m b
 foldM f z0 xs = foldr (\x k z -> f z x >>= k) pure xs z0

 func :: Int -> IO Int
 func n = foldM step 0 xs
     where
     xs = map (n+) [1,2,3,4,5,6,7,8,9,10]
     step acc x =
         case x `mod` 3  of
             0 -> pure acc
             1 -> pure $ acc + 1
             2 -> pure $ acc + 2

 }}}

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


More information about the ghc-tickets mailing list