TTG: Handling Source Locations

Ryan Scott at
Wed Feb 13 10:59:13 UTC 2019

> Yes, I have reported it while back. I don't know of the progress in
fixing this.

Reported what? #15884? [1] You do realize that there is a very simple
workaround for that issue, right? Instead of writing this, which is subject
to the pattern-guard completeness issues observed in #15753:

    f :: Maybe a -> Bool
    f (id->Nothing)  = False
    f (id->(Just _)) = True

You can instead write this:

    f :: Maybe a -> Bool
    f (id -> x) =
      case x of
        Nothing -> False
        Just _  -> True

This will get proper coverage checking, which means that this technique
could be used to remove all of the panicking catch-all cases brought about
by dL view patterns.

Ryan S.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the ghc-devs mailing list