Add inference for function signatures
Merge branch 'master' into mammoth