File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 1+ {-
2+ stack exec ghc -- -O0 -rtsopts -with-rtsopts=-K1k ./stackoverflow.hs
3+ stack exec ghc -- -O0 -rtsopts -with-rtsopts=-K1k -XStrict ./stackoverflow.hs
4+ stack exec ghc -- -O1 -rtsopts -with-rtsopts=-K1k ./stackoverflow.hs
5+ stack exec ghc -- -O1 -rtsopts -with-rtsopts=-K1k -XStrict ./stackoverflow.hs
6+ -}
7+
8+ import Control.Exception
9+ import Data.List
10+
11+ main :: IO ()
12+ main = do
13+ let size = 5000
14+ putStrLn " BEGIN"
15+ evaluate $ foldl (\ z x -> x : z) [] [1 .. size]
16+ putStrLn " DONE"
Original file line number Diff line number Diff line change @@ -16,8 +16,5 @@ main = do
1616 evaluate $ foldr (:) [] [1 .. size]
1717 putStrLn " DONE: foldr 1"
1818
19- evaluate $ foldl (\ z x -> x : z) [] [1 .. size]
20- putStrLn " DONE: foldl"
21-
2219 evaluate $ foldr (\ x z -> x : z) [] [1 .. size]
2320 putStrLn " DONE: foldr 2"
You can’t perform that action at this time.
0 commit comments