def unify(self, oth_type_def: TypeExprComponent, blhs, brhs) -> TypeExprComponent:
print("<STR_LIT>" % (self, oth_type_def))<EOL>if type(oth_type_def) is not Fun:<EOL><INDENT>if type(oth_type_def) is T:<EOL><INDENT>return self[<NUM_LIT:0>].unify(oth_type_def, blhs, brhs)<EOL><DEDENT>raise "<STR_LIT>"<EOL><DEDENT>diff_len = len(self) - len(oth_type_def)<EOL>if diff_len < <NUM_LIT:0>: <EOL><INDENT>return None<EOL><DEDENT>for a, b in zip(reversed(self), reversed(oth_type_def)):<EOL><INDENT>if not a.unify(b, blhs, brhs):<EOL><INDENT>return None<EOL><DEDENT><DEDENT>return Fun(*self[:diff_len])<EOL>
When we unify a function vs another type def we match each term and we return the rest.

t1 -> t2 -> t3 ?? t1 -> t2 match and we return t3
t1 -> t2 ?? t1 -> t2 -> t3 didn't match

Note: the first element is the return type