Introduce local type variables in patterns#9579
Conversation
|
I think it would be nice to reach a form of consensus (among the people who expressed interest in the topic before: @lpw25, @yallop, @alainfrisch, you and myself; for example) before implementing things -- or maybe to clearly mark implementations as prototypes for experiment. Since this discussion was resurrected last week, @yallop, @lpw25 and myself have expressed support the form Personally I am not very enthusiastic about the introduction of yet another pair of delimiters. I already find |
|
As I said, this is experimental, and the delimiters Independently of that, the problem of the scoping of unification type variables is a long standing one too. Solving it in a way that makes such examples work would certainly be nice. |
|
I'm closing this since the alternative #9584 has been merged. |
|
Actually, #9584 does not subsume this. |
This is a first step towards having local type variables, whose level is chosen from their introduction point.
This is a very simple (but partial) solution to the existential naming problem (#7074).
Due to conflicts, the syntax is
<'a 'b> pattern.Here is a simple example using GADTs: