summaryrefslogtreecommitdiff
path: root/testsuite/tests/simplCore/should_compile/T9441b.hs
blob: 464c96e63feac1615d8d322d4fd0ba9432d81f97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module T9441b where

f1 :: Integer -> Integer
f1 n
    | n <= 1 = 1
    | otherwise = go n 1
  where
    go 0 r = r
    go m r = go (m - 1) (r * m)

f2 :: Integer -> Integer
f2 n = go n 1
  where
    go 0 s = s
    go p s = go (p - 1) (s * p)