by jsjohnst · 1y ago · 0 comments
> # fun x -> x + 1;;
> - : int -> int = <fun>
>2) inferring the type is int isn’t guaranteed to be correct in this case
That's the downside of operator overloading - since it relies on types to resolve, they need to be known and can't be inferred.
No it’s not. It’s Optional[int] -> int at minimum. There are other completely valid signatures beyond that too.