summaryrefslogtreecommitdiff
path: root/testsuite/tests/arityanal/should_compile/T18793.hs
blob: 6dfdcf05eea0d6203e33a6186b0c43a6967da437 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
module T18793 where

stuff :: Int -> [Int]
{-# NOINLINE stuff #-}
stuff i = [i,i+1,i+2]

f :: Int -> Int
f = foldr k id (stuff 1)
  where
    k :: Int -> (Int -> Int) -> (Int -> Int)
    k i acc | i > 42    = acc . negate
            | otherwise = acc