Added global type inference for monomorphic functions. Type constructors
probably don't work properly for the time being.