Open pchiusano opened 2 years ago
Yeah, I kind of wonder how many type errors of the multiple variable sort are caused by inferring this sort of type for intermediate steps.
Totally.
I just noticed that h3
appears on the Location
but not in the result.
But applying the same simplification rule again, the variable set {g, h3}
is never separated elsewhere in the signature, so we might as well just call that g
, which yields the desired signature.
We managed to infer the following type:
Notice that
{h, h1, h2}
are always together in the inferred type. So we might as well just call that parameterh
. They are also duplicated.Deduplicated and coalesced, we get the nice type
Which is something a human might write.
I'd say this isn't super high priority, but it'd be a nice win for the inference algorithm. The more times that inference gives something sensible the better.