<div dir="ltr">This looks like an improvement to me. I love the idea of a visual demarcation between sections, too; the bullets seem like a good choice there (the horizontal lines seem like they'd take up more space).<div><br></div><div><br></div><div>Ryan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Oct 24, 2015 at 6:07 AM, Roman Cheplyaka <span dir="ltr"><<a href="mailto:roma@ro-che.info" target="_blank">roma@ro-che.info</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I have the same issue with the current error messages. I think these are<br>
all good ideas.<br>
<div class="HOEnZb"><div class="h5"><br>
On 10/24/2015 05:48 AM, Evan Laforge wrote:<br>
> Here's a typical simple type error from GHC:<br>
><br>
> Derive/Call/India/Pakhawaj.hs:142:62:<br>
> Couldn't match type ‘Text’ with ‘(a1, Syllable)’<br>
> Expected type: [([(a1, Syllable)], [Sequence Bol])]<br>
> Actual type: [([Syllable], [Sequence Bol])]<br>
> Relevant bindings include<br>
> syllables :: [(a1, Syllable)]<br>
> (bound at Derive/Call/India/Pakhawaj.hs:141:16)<br>
> best_match :: [(a1, Syllable)]<br>
> -> Maybe (Int, ([(a1, Syllable)], [(a1, Sequence Bol)]))<br>
> (bound at Derive/Call/India/Pakhawaj.hs:141:5)<br>
> In the second argument of ‘mapMaybe’, namely ‘all_bols’<br>
> In the second argument of ‘($)’, namely<br>
> ‘mapMaybe (match_bols syllables) all_bols’<br>
><br>
> I've been having more trouble than usual reading GHC's errors, and I<br>
> finally spent some time to think about it. The problem is that this new<br>
> "relevant bindings include" section gets in between the expected and<br>
> actual types (I still don't like that wording but I've gotten used to<br>
> it), which is the most critical part, and the location context, which is<br>
> second most critical. Notice the same effect in the previous sentence<br>
> :) After I see a type error the next thing I want to see is the where<br>
> it happened, so I have to skip over the bindings, which can be long and<br>
> complicated. Then I usually know what to do, and only look into the<br>
> bindings if something more complicated is going on, like wonky<br>
> inference. So how about reordering the message:<br>
><br>
> Derive/Call/India/Pakhawaj.hs:142:62:<br>
> Couldn't match type ‘Text’ with ‘(a1, Syllable)’<br>
> Expected type: [([(a1, Syllable)], [Sequence Bol])]<br>
> Actual type: [([Syllable], [Sequence Bol])]<br>
> In the second argument of ‘mapMaybe’, namely ‘all_bols’<br>
> In the second argument of ‘($)’, namely<br>
> ‘mapMaybe (match_bols syllables) all_bols’<br>
> Relevant bindings include<br>
> syllables :: [(a1, Syllable)]<br>
> (bound at Derive/Call/India/Pakhawaj.hs:141:16)<br>
> best_match :: [(a1, Syllable)]<br>
> -> Maybe (Int, ([(a1, Syllable)], [(a1, Sequence Bol)]))<br>
> (bound at Derive/Call/India/Pakhawaj.hs:141:5)<br>
><br>
> After this, why not go one step further and set off the various sections<br>
> visibly to make it easier to scan. The context section can also be<br>
> really long if it gets an entire do block or record:<br>
><br>
> Derive/Call/India/Pakhawaj.hs:142:62:<br>
> * Couldn't match type ‘Text’ with ‘(a1, Syllable)’<br>
> Expected type: [([(a1, Syllable)], [Sequence Bol])]<br>
> Actual type: [([Syllable], [Sequence Bol])]<br>
> * In the second argument of ‘mapMaybe’, namely ‘all_bols’<br>
> In the second argument of ‘($)’, namely<br>
> ‘mapMaybe (match_bols syllables) all_bols’<br>
> * Relevant bindings include<br>
> syllables :: [(a1, Syllable)]<br>
> (bound at Derive/Call/India/Pakhawaj.hs:141:16)<br>
> best_match :: [(a1, Syllable)]<br>
> -> Maybe (Int, ([(a1, Syllable)], [(a1, Sequence Bol)]))<br>
> (bound at Derive/Call/India/Pakhawaj.hs:141:5)<br>
><br>
> Or alternately, taking up a bit more vertical space:<br>
><br>
> Derive/Call/India/Pakhawaj.hs:142:62:<br>
> Couldn't match type ‘Text’ with ‘(a1, Syllable)’<br>
> Expected type: [([(a1, Syllable)], [Sequence Bol])]<br>
> Actual type: [([Syllable], [Sequence Bol])]<br>
> -----------------------------<br>
> In the second argument of ‘mapMaybe’, namely ‘all_bols’<br>
> In the second argument of ‘($)’, namely<br>
> ‘mapMaybe (match_bols syllables) all_bols’<br>
> -----------------------------<br>
> Relevant bindings include<br>
> syllables :: [(a1, Syllable)]<br>
> (bound at Derive/Call/India/Pakhawaj.hs:141:16)<br>
> best_match :: [(a1, Syllable)]<br>
> -> Maybe (Int, ([(a1, Syllable)], [(a1, Sequence Bol)]))<br>
> (bound at Derive/Call/India/Pakhawaj.hs:141:5)<br>
><br>
> Thoughts? It seems simple enough that I could do myself, but of course<br>
> not without buy-in.<br>
<br>
<br>
</div></div><br>_______________________________________________<br>
Glasgow-haskell-users mailing list<br>
<a href="mailto:Glasgow-haskell-users@haskell.org">Glasgow-haskell-users@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users</a><br>
<br></blockquote></div><br></div>