<div dir="ltr"><div class="markdown-here-wrapper" style=""><p style="margin:0px 0px 1.2em!important">I have just confirmed that we can specify <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">HasCallStack</code> separately for different instance of same typeclass, and <a href="https://gist.github.com/luochen1990/bc556d0fc6a1355e5d1bd27a81114870">here</a> is the test code.</p>
<div title="MDH:SSBoYXZlIGp1c3QgY29uZmlybWVkIHRoYXQgd2UgY2FuIHM8c3BhbiBzdHlsZT0iY29sb3I6IHJn
YigzNiwgNDEsIDQ2KTsgZm9udC1mYW1pbHk6IC1hcHBsZS1zeXN0ZW0sIEJsaW5rTWFjU3lzdGVt
Rm9udCwgJnF1b3Q7U2Vnb2UgVUkmcXVvdDssIEhlbHZldGljYSwgQXJpYWwsIHNhbnMtc2VyaWYs
ICZxdW90O0FwcGxlIENvbG9yIEVtb2ppJnF1b3Q7LCAmcXVvdDtTZWdvZSBVSSBFbW9qaSZxdW90
OywgJnF1b3Q7U2Vnb2UgVUkgU3ltYm9sJnF1b3Q7OyBmb250LXNpemU6IDE0cHg7Ij5wZWNpZnkg
YEhhc0NhbGxTdGFja2Agc2VwYXJhdGVseSBmb3IgZGlmZmVyZW50IGluc3RhbmNlIG9mIHNhbWUg
dHlwZWNsYXNzLCBhbmQgW2hlcmVdKDwvc3Bhbj48YSBocmVmPSJodHRwczovL2dpc3QuZ2l0aHVi
LmNvbS9sdW9jaGVuMTk5MC9iYzU1NmQwZmM2YTEzNTVlNWQxYmQyN2E4MTExNDg3MCI+aHR0cHM6
Ly9naXN0LmdpdGh1Yi5jb20vbHVvY2hlbjE5OTAvYmM1NTZkMGZjNmExMzU1ZTVkMWJkMjdhODEx
MTQ4NzA8L2E+KSBpcyB0aGUgdGVzdCBjb2RlLg==" style="height:0;width:0;max-height:0;max-width:0;overflow:hidden;font-size:0em;padding:0;margin:0"></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Oliver Charles <<a href="mailto:ollie@ocharles.org.uk">ollie@ocharles.org.uk</a>> 于2019年6月17日周一 上午3:02写道:<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="auto">Surely then the call stack is only foldr1, and not foldr1's callsite?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 16 Jun 2019, 8:27 pm Henning Thielemann, <<a href="mailto:lemming@henning-thielemann.de" target="_blank">lemming@henning-thielemann.de</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"><br>
On Sun, 16 Jun 2019, Simon Jakobi wrote:<br>
<br>
> >  I think only the partial implementations should get that constraint.<br>
<br>
> Oops, I had the misconception that one couldn't add a HasCallStack <br>
> constraint to method implementations.<br>
<br>
I think you have to declare:<br>
<br>
instance Foldable [] where<br>
    foldl1 = foldl1List<br>
<br>
foldl1List :: HasCallStack => (a->a->a) -> [a] -> a<br>
foldl1List = ...<br>
<br>
Would this work?_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" rel="noreferrer" target="_blank">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote></div>
</blockquote></div>