more efficient encoding of function types