Emit purity to function dox

Closes #3804