type directive factory with Function type

- the existing type fails with the stricter 0.9.5 compiler

let me know if this is fine to merge or not.