Created
May 31, 2014 15:06
-
-
Save Shimuuar/7da4d4312bffd937e810 to your computer and use it in GitHub Desktop.
Manual float out
This file contains hidden or 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
import Debug.Trace | |
xs1,xs2 :: [Int] | |
xs1 = map (\x -> (trace "2" 2 + trace "3" 3) * x) [0..] | |
xs2 = map (let y = trace "2" 2 + trace "3" 3 in \x -> x*y) [0..] | |
{- | |
*Main> take 4 xs1 | |
[2 | |
3 | |
0,2 | |
3 | |
5,2 | |
3 | |
10,2 | |
3 | |
15] | |
*Main> take 4 xs2 | |
[2 | |
3 | |
0,5,10,15] | |
-} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment