[Haskell-cafe] RebindableSyntax and fail in GHC 8
cdsmith at gmail.com
Wed Dec 21 21:52:12 UTC 2016
Thanks Richard, I will file the bug shortly.
David, fail doesn't appear to be used at all, either for pattern match
failure (which I initially expected), or for guards. Example here:
On Wed, Dec 21, 2016 at 12:56 PM, David Menendez <dave at zednenem.com> wrote:
> On Tue, Dec 20, 2016 at 3:53 AM, Chris Smith <cdsmith at gmail.com> wrote:
>> Hey everyone,
>> Can someone explain to me by GHC 8 causes list comprehension bindings to
>> desugar to use 'fail', when RebindableSyntax is enabled in GHC 8? Note
>> that I do not have monad comprehensions enabled. If I define fail,
>> everything works (apparently regardless of what I define fail to do?!?),
>> but I'd like to understand why it's necessary.
> Perhaps fail is used by the translation for guards. I don’t have a working
> GHC right now, but what happens if you define fail = error and evaluate [ x
> | x <- “a", False]?
> Dave Menendez <dave at zednenem.com>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe