Make function type rendering prettier
This commit is contained in:
parent
97cd81dc43
commit
d94ff158f7
|
@ -65,7 +65,11 @@ class FunctionTy:
|
||||||
return self.arg_type.free_vars() | self.ret_type.free_vars()
|
return self.arg_type.free_vars() | self.ret_type.free_vars()
|
||||||
|
|
||||||
def __repr__(self) -> str:
|
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)
|
@dataclass(frozen=True)
|
||||||
class HoleTy:
|
class HoleTy:
|
||||||
|
|
Loading…
Reference in a new issue