
16 Feb
2011
16 Feb
'11
5:49 p.m.
When I learn a new language, I like to look at the assembly code for some simple fcn calls. I tried GHC -S on the following program: add' x y = x + y main = do print $ add' 1 2 The result of ghc -S add.hs was 301 lines of assembly code. Adding an explicit type annotation for add' brought it down to 252 lines, and the code was still beyond my meager ability to take in assembly. Is there a good reference that gives a simple explanation of how Haskell function calls work? This seems crucial to understanding how to efficiently use the language, given what I've read about tail call optimization. thanks Lee Short