documentation for generic higher-order functions
fixes #319