diff options
author | Anthony Wang | 2022-01-14 12:08:16 -0600 |
---|---|---|
committer | Anthony Wang | 2022-01-14 12:08:23 -0600 |
commit | 3a9fe78bb74d3a8482d746524d7c8f2876d8692f (patch) | |
tree | a29be51851614cd861f50382093f967699e30204 | |
parent | 598287afd48b618316bfe38282c69e835b3aa706 (diff) |
Haskell: use sum instead of foldl
-rw-r--r-- | test.hs | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -9,4 +9,4 @@ main = do putStrLn "test" let n = 1000 let a = [0..n-1] - print $ foldl (+) 0 (map (\i -> foldl (+) 0 (map (`gcd` i) a)) a) + print $ sum (map (\i -> sum (map (`gcd` i) a)) a) |