TTG: Handling Source Locations

Ryan Scott ryan.gl.scott at gmail.com
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.
-----
[1] https://ghc.haskell.org/trac/ghc/ticket/15884
[2] https://ghc.haskell.org/trac/ghc/ticket/15753
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20190213/914d8e3c/attachment.html>


More information about the ghc-devs mailing list