Ticket #3772: Tst.hs

File Tst.hs, 196 bytes (added by rl, 4 years ago)
Line 
1foo [] = []
2foo (x:xs) = (x,x) : foo xs
3
4plus :: [(Integer, Integer)] -> Integer -> Integer
5plus [] n = n
6plus ((x,y) : xs) n = plus xs $! (x + y + n)
7
8main = print (plus (foo [1..100000000]) 0)
9