Original article: http://www.altdevblogaday.com/2012/04/26/functional-programming-in-c/
Author: John Carmack
-Pan Hong
-March January 2013
-Email:
Popyy@netease.com
-Weibo.com/panhong101
Study some of the functions in your code library, track the various external States they will touch, and the various data they will modify. Even if you haven't made any changes to the code, you can get a good document by writing comments to the results. If another function can update the screen through the rendering system, you can raise your hand to announce what mechanisms are beyond human understanding in the code.
The next step is to start thinking about how these functions work. Collect program input, pass them into a pure function, and finally obtain and process those results.
While debugging the Code, be cautious with status changes and implicit parameters. They often mask the actual situation of the program running.
Modify some tool object code, and change the function of changing the object to copy the returned result. Try to add the const modifier before each non-iterator object used.
References:
Http://www.haskell.org/haskellwiki/Introduction
Http://lisperati.com/
Http://www.johndcook.com/blog/tag/functional-programming/
Http://www.cs.kent.ac.uk/people/staff/dat/miranda/whyfp90.pdf
Http://channel9.msdn.com/Shows/Going+Deep/Lecture-Series-Erik-Meijer-Functional-Programming-Fundamentals-Chapter-1
Http://www.cs.utah.edu /~ Hal/docs/daume02yaht.pdf
Http://www.cs.cmu.edu /~ Crary/819-f09/backus78.pdf
Http://fpcomplete.com/the-downfall-of-imperative-programming/