fork download
  1. f1 :: Int -> Int -> Int
  2. f1 x y= x + y
  3. g1::a->(a->a->a)->[a]->a
  4. g1 n f xs
  5. |null xs = n
  6. |otherwise = let x = head xs
  7. xs2 = tail xs
  8. n2 = f n x
  9. in g1 n2 f xs2
  10. main :: IO()
  11. main = let
  12. t=g1 0 f1 [1,2,3,4]
  13. in print t
Success #stdin #stdout 0.01s 5316KB
stdin
Standard input is empty
stdout
10