<html><head><style id="css_styles" type="text/css"><!--blockquote.cite { margin-left: 5px; margin-right: 0px; padding-left: 10px; padding-right:0px; border-left: 1px solid #cccccc }
blockquote.cite2 {margin-left: 5px; margin-right: 0px; padding-left: 10px; padding-right:0px; border-left: 1px solid #cccccc; margin-top: 3px; padding-top: 0px; }
a img { border: 0px; }
li[style='text-align: center;'], li[style='text-align: right;'] {  list-style-position: inside;}
body { font-family: Segoe UI; font-size: 12pt;   }--></style></head><body><div>Hi Richard,</div><div><br /></div><div>I'm not sure if I'm missing something, but my adolescent naivety in frontend matters would try to reach for</div><div><a href="https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0155-type-lambda.rst#motivation" style="font-size: 12pt;">https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0155-type-lambda.rst#motivation</a> and write</div><div><br /></div><div><div><div><div id="xe77d6f56a39e422" style="word-wrap:break-word;-webkit-nbsp-mode:space;line-break:after-white-space;"><span class="" style="caret-color: rgb(0, 0, 0);">  MkRec { field = \@a -> ... }</span></div></div></div></div><div id="xe77d6f56a39e422" style="word-wrap:break-word;-webkit-nbsp-mode:space;line-break:after-white-space;"><span class="" style="caret-color: rgb(0, 0, 0);"><br /></span></div><div id="xe77d6f56a39e422" style="word-wrap:break-word;-webkit-nbsp-mode:space;line-break:after-white-space;"><span class="" style="caret-color: rgb(0, 0, 0);">and I hope that will do the right thing. Indeed, I interpret your proposed `</span><span>field @a = ...` as much the same.</span></div><div id="xe77d6f56a39e422" style="word-wrap:break-word;-webkit-nbsp-mode:space;line-break:after-white-space;"><br /></div><div id="xe77d6f56a39e422" style="word-wrap:break-word;-webkit-nbsp-mode:space;line-break:after-white-space;">Sebastian</div><div id="xe77d6f56a39e422" style="word-wrap:break-word;-webkit-nbsp-mode:space;line-break:after-white-space;"><br /></div>
<div><br /></div>
<div>------ Originalnachricht ------</div>
<div>Von: "Richard Eisenberg" <<a href="mailto:lists@richarde.dev">lists@richarde.dev</a>></div>
<div>An: "Erdi, Gergo via ghc-devs" <<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a>></div>
<div>Gesendet: 16.05.2022 21:09:33</div>
<div>Betreff: ambiguous record field (but not *that* kind of ambiguous record field)</div><div><br /></div>
<div id="xe77d6f56a39e422" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><blockquote cite="010f0180ce4693b6-e3d38276-57f1-4fe4-a753-4b3ccd9da3b9-000000@us-east-2.amazonses.com" type="cite" class="cite2">
<span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">Hi all,</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="" /><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="" /><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">On a project I'm working on, I wish to declare something like</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="" /><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="" /><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">data Rec = MkRec { field :: forall a. SomeConstraint a => ... }</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="" /><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="" /><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">where the ... contains no mention of `a`.</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="" /><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="" /><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">Even with </span><a href="https://github.com/ghc-proposals/ghc-proposals/pull/448" class="">https://github.com/ghc-proposals/ghc-proposals/pull/448</a><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">, I think there is no way to avoid the ambiguity when setting `field`. Is that correct? If so, what shall we do about it? The natural answer is somehow to write ... MkRec { field @a = ... } ... but that would break significant new syntactic ground. (Maybe it's good new syntactic ground, but it would still be very new.)</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="" /><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="" /><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">Thanks,</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="" /><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">Richard</span></blockquote></div>
</body></html>