<div dir="ltr">That instance seems fine to me.<div><br></div><div>It won't solve the general case of proxy arguments are those should typically be type variables rather than fixed Proxy type, so using an overloaded label would be ambiguous without a type signature:<br><br>example :: proxy a -> Int</div><div><br></div><div>So if you were designing an API intended to be used with an overloaded label it would probably make sense to pick a different type and just define the instance locally:</div><div><br></div><div>data StringProxy (str :: Symbol) = StringProxy; instance x ~ a => IsLabel x (StringProxy a) where fromLabel = StringProxy</div><br><div>since you were building an API intended to be used with overloaded labels. The user would find this less surprising as you'd be able to attach documentation to StringProxy explaining how it was intended to be used.</div><div><br></div><div>-Eric</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 7, 2020 at 1:48 AM Fumiaki Kinoshita <<a href="mailto:fumiexcel@gmail.com">fumiexcel@gmail.com</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 dir="ltr"><div>I propose adding an IsLabel instance to Proxy where </div><div><br></div><div>   fromLabel = Proxy</div><div><br></div><div>This is the only reasonable instance I can think of, and AFAIK there's no plan which would conflict [0].</div><div><br></div><div>The proposed instance allows us to explore API designs involving type-level strings with much less syntactic noise ( #foo is easier to type than @"foo"). I admit that the motivation is weak, but I think it's nice to have.</div><div><br></div><div>[0] <a href="https://gitlab.haskell.org/ghc/ghc/-/wikis/records/overloaded-record-fields/magic-classes" target="_blank">https://gitlab.haskell.org/ghc/ghc/-/wikis/records/overloaded-record-fields/magic-classes</a><br></div></div>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">Eric Mertens</div>