Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Data.Function (fix)
- work x = (`fix` (1, 0)) $ \loop (i, y) ->
- if i > x then y else loop (i+1, y+i)
- main = do
- putStrLn $ "Sum of 1..10 = " ++ show (work 10)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement