Basic function parameter type check and return type inferrence; works with templates.