<div dir="ltr">Thanks!  Yeah, I just wondered if this was known, or if there's an easy way around it that I was missing.<div><br></div><div>For my specific case, I can do just as well by defining a type synonym, and then post-processing the error messages from GHC.  That's all stuff I already do, so there's no need to do any work on my account. :)</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Feb 7, 2016 at 7:06 PM, Richard Eisenberg <span dir="ltr"><<a href="mailto:eir@cis.upenn.edu" target="_blank">eir@cis.upenn.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>If you have a use-case that requires an expansion of RebindableSyntax, please post a feature request. There is a very limited number of person-hours devoted to improving GHC, so we need concrete direction from users.</div><div><br></div><div>That said, RebindableSyntax has gotten quite a face-lift for 8.0, mostly internally. But it means that some types are more flexible than they were. However, neither problem in this thread is addressed by the changes.</div><div><br></div><div>But to the email below: I'm not sure how we would support anything but Bool. According to the Report,</div><div><br></div><div>> f "r" = "rrr"</div><div><br></div><div>becomes</div><div><br></div><div>> f x | x == "r" = "rrr"</div><div><br></div><div>Because the result of == is used as a guard, it would have to be a Bool. I'd be all for a new -XOverloadedBooleans, but that's still separate from RebindableSyntax.</div><div><br></div><div>The enumFromTo bit would be easy to fix, though. If you want it for practical purposes (that is, not just because its omission is aesthetically suboptimal -- which it is), please post a feature request.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Richard</div></font></span><div><div class="h5"><br><div><div>On Feb 7, 2016, at 3:00 PM, Adam Bergmark <<a href="mailto:adam@bergmark.nl" target="_blank">adam@bergmark.nl</a>> wrote:</div><br><blockquote type="cite"><div dir="ltr">There are a number of things one might expect RebindableSyntax to support, but it doesn't. Another examples is that `[1..2]' uses `GHC.Enum.enumFromTo' instead of the `enumFromTo' in scope.<div><br></div><div>My guess is that RebindableSyntax isn't on the priority list.</div><div><br></div><div>- Adam</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Feb 7, 2016 at 8:08 PM, Chris Smith <span dir="ltr"><<a href="mailto:cdsmith@gmail.com" target="_blank">cdsmith@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">In a custom prelude, I have written the following definitions:<div><br></div><div>data Truth = True | False</div><div><br></div><div>ifThenElse :: Truth -> a -> a -> a</div><div>ifThenElse True x _ = x</div><div>ifThenElse False _ x = x</div><div><br></div><div>(==) :: a -> a -> Truth</div><div>(==) = ...</div><div><br></div><div>I'm replacing Bool with my own Truth type.  Clients will be built with RebindableSyntax, so that they will use these definitions for desugaring.</div><div><br></div><div>However, if I write this:</div><div><br></div><div>f :: Text -> Text</div><div>f "r" = "rrr"</div><div>f other = other</div><div><br></div><div>I get a build error indicating that GHC expected the (==) operator to return a value of type Bool, rather than Truth.</div><div><br></div><div>Shouldn't pattern matching desugar to use overloaded ifThenElse in these situations?  Or is it expected that use of GHC.Types.Bool is hard-coded even with RebindableSyntax enabled?</div><div><br></div><div>Thanks,</div><div>Chris</div></div>
<br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br></div>
_______________________________________________<br>Haskell-Cafe mailing list<br><a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br><a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br></blockquote></div><br></div></div></div></blockquote></div><br></div>