<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif">I support acceptance. Let's land this soon.</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Simon<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 6 Jan 2024 at 04:45, Richard Eisenberg <<a href="mailto:rae@richarde.dev">rae@richarde.dev</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;">Hi all,<div><br></div><div>I've reviewed Arnaud's <a href="https://github.com/ghc-proposals/ghc-proposals/pull/624" target="_blank">https://github.com/ghc-proposals/ghc-proposals/pull/624</a> and wish to recommend acceptance.</div><div><br></div><div>The proposal is an amendment to the proposal for linear types, adding support for linear let bindings.</div><div><br></div><div>Today, if you have</div><div><br></div><div>f :: T %1-> T</div><div>f t = let t2 = t in t2</div><div><br></div><div>you'll get an error because t2 is not linear. The only way to bind a linear variable is via a `case`, never a `let` or `where`. This is annoying. With this proposal, the little program above is accepted, with an inferred linearity restriction on t2. Users can also annotated their lets like `let %1 x = ... in ...`. Bindings in `where` clauses can also be inferred or annotated as linear.</div><div><br></div><div>There is a downside, of course: linear bindings have various restrictions, chiefly that they must be strict bindings (because projections are hard with linear types) and that bindings cannot be generalized. I'm a little unsure that the choices in the proposal (particularly around generalization) are the best for users, but I think the best way to learn is to experiment. In my understanding, the community knows that -XLinearTypes is subject to revision, and so I think we should just blast ahead, revising if and when necessary.</div><div><br></div><div>Please share your thoughts!</div><div><br></div><div>Thanks,</div><div>Richard</div></div>_______________________________________________<br>
ghc-steering-committee mailing list<br>
<a href="mailto:ghc-steering-committee@haskell.org" target="_blank">ghc-steering-committee@haskell.org</a><br>
<a href="https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee" rel="noreferrer" target="_blank">https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee</a><br>
</blockquote></div>