Created
February 4, 2015 11:55
-
-
Save shigemk2/d0fcb798b3ca9c94f758 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main = do | |
print $ foldl (+) 0 $ take 10 [1..] | |
-- print $ take 10 $ foldl (\x y -> y : x) [] [1..] -- 無限ループ | |
print $ take 10 $ foldr (\a b -> [a] ++ b) [] [1..] | |
-- print $ take 10 $ foldl (\a b -> [a] ++ b) [] [1..] -- エラー |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment