let f = choose_one x y z -- different arities​
in f n m

So this code fragment gets the type:
{choose_one :: 'a 'b 'c -> (fn 'd 'e -> 'f), x :: 'a, y :: 'b, z :: 'c, n:
'd, m: 'e} -> 'f

Note, you can't type this fragment in HM as it has open types, but we can
type it with named implicit variables as above.

To know what happens we need a type for choose_one. Whichever of x y z it
chooses will get the type:

{x :: fn 'd 'e -> 'f ... } -> 'f

And we can pass any definition into 'x' that satisfies the normal subtyping
subsumption rule.


Keean.



On 21 February 2015 at 12:11, Matt Oliveri <[email protected]> wrote:

> I keep forgetting to ask, Keean, how does your proposal handle
> William's choose_one example?
> _______________________________________________
> bitc-dev mailing list
> [email protected]
> http://www.coyotos.org/mailman/listinfo/bitc-dev
>
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to