summaryrefslogtreecommitdiff
path: root/testsuite/tests/profiling/should_run/T680.hs
blob: bf5fc3ae0c5c7e220daba1c3279a4e38123bbb25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
foo :: (() -> () -> [()] -> [()]) -> () -> [()] -> [()]
foo k =
  \_ xs -> concatMap ($ [head xs]) [bar]
 where
  bar =
    let k' = k undefined undefined
    in  \xs ->
          let k'' = [k' xs]
          in  (() : (foldr1 (>>) k''))

k :: () -> [()] -> [()]
k = foo (\_ -> k)

--k a = foo (\_ -> k) a

-- all the work should happen in r
r :: ()
r = k undefined [] !! 4000

main = print r