Created
May 5, 2011 03:51
-
-
Save jutememo/956504 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
foldr3 _ z [] k = k z | |
foldr3 f_cps z (x:xs ) k = f_cps x (foldr3 f_cps z xs k) $ \y -> k y | |
main = do print $ foldr3 (\x y k -> k $ x + y) 0 [1..3] id | |
print $ foldr3 (\x y k -> k $ x + y) 0 [1..3] (* 2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment