lookupBindGroupOcc: recommend names in the same namespace (#17593)
[ghc.git] / testsuite / tests / perf / should_run / T4830.hs
1 -- Compile with O2; SpecConstr should fire nicely
2 -- and eliminate all allocation in inner loop
3
4 module Main where
5
6 foo :: Int -> Maybe (Double,Double) -> Double
7 foo _ Nothing = 0
8 foo 0 (Just (x,y)) = x+y
9 foo n (Just (x,y)) = let r = f x y in r `seq` foo (n-1) (Just r)
10 where
11 f x y | x <= y = (x,y)
12 | otherwise = (y,x)
13
14 main = print (foo 1000000 (Just (1,2)))
15