Created
September 22, 2012 22:03
-
-
Save arianvp/3767979 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
7 main :: IO() | |
6 main = do | |
5 | |
4 forM [1000000..5000000] $ \x -> do | |
3 a <- getCPUTime | |
2 return $! fib x | |
1 b <- getCPUTime | |
0 putStrLn $ show ((b-a) `div` 10^9) | |
=============================================================== | |
Press ENTER or type command to continue | |
[1 of 1] Compiling Main ( higher-order-functions.hs, higher-order-functions.o ) | |
higher-order-functions.hs:59:5: | |
Couldn't match expected type `()' with actual type `[()]' | |
Expected type: IO () | |
Actual type: IO [()] | |
In a stmt of a 'do' block: | |
forM [1000000 .. 5000000] | |
$ \ x | |
-> do { a <- getCPUTime; | |
return $! fib x; | |
.... } | |
In the expression: | |
do { forM [1000000 .. 5000000] $ \ x -> do { ... } } | |
shell returned 1 | |
Press ENTER or type command to continue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment