diff --git a/types_.py b/types_.py index bf62656..643d758 100644 --- a/types_.py +++ b/types_.py @@ -65,7 +65,11 @@ class FunctionTy: return self.arg_type.free_vars() | self.ret_type.free_vars() def __repr__(self) -> str: - return f'({self.arg_type}) -> {self.ret_type}' + arg = repr(self.arg_type) + if ' ' in arg: + return f'({arg}) -> {self.ret_type}' + else: + return f'{arg} -> {self.ret_type}' @dataclass(frozen=True) class HoleTy: