Allow result types to have type parameters. Fixes #11