fork download
  1. myfoldl _ v [] = v
  2. myfoldl f v (x:xs) = myfoldl f (f v x) xs
  3.  
  4. mysum =  myfoldl (+) 0
  5.  
  6. sumlist xs = [mysum [1..x] | x <- xs]
  7.  
  8. mytake 0 _ = []
  9. mytake n (x:xs) = x:mytake (n - 1) xs
  10.  
  11. main = print (mytake 10 (sumlist [1..1000000]))
  12.  
  13.  
Success #stdin #stdout 0.02s 3592KB
stdin
Standard input is empty
stdout
[1,3,6,10,15,21,28,36,45,55]