def type_fun(a): if a is None or c_type is None: return None eftype = ef1.type_fun(types.FType((a.type, c_type.type))) if eftype is None: return None (b, c) = eftype.type if not types.is_of_type(c_type, types.FType(c)): raise types.FTypeException("%s is not of type %s" % (c, c_type)) return types.FType(b)
def type_fun(t): if t is None or init_type is None: return None try: (c, a) = t.type except (TypeError, ValueError): raise types.FTypeException("%s not an instance of (c * E a)" % a) f_out_type = f.type_fun(types.FType((init_type.type, a.type))) if not types.is_of_type(f_out_type, init_type): raise types.FTypeException( "%s not of expected type: f generates %s instead of %s" % (t, f_out_type, init_type)) return types.FType((c, init_type.type))
def type_fun(test_in_type): if in_type is None or types.is_of_type(test_in_type, in_type): return out_type else: raise types.FTypeException("%s not of type %s" % (test_in_type, in_type))
def type_fun(test_in_type): if in_type is None or types.is_of_type(test_in_type, in_type): return out_type else: raise types.FTypeException( "%s not of type %s" % (test_in_type, in_type))