rewrite some examples and bring in new ones parsed from the documentation
Merge pull request #1200 from teroka/func_examples

rewrite some examples and bring in new ones parsed from the docs