Suppressing False Incomplete Pattern Matching Warnings for Polymorphic Pattern Synonyms
rae at cs.brynmawr.edu
Thu Oct 25 12:51:29 UTC 2018
This sounds like an infelicity in COMPLETE pragmas. Do we have a documented reason why fixing this is impossible?
> On Oct 25, 2018, at 7:36 AM, Shayan Najd <sh.najd at gmail.com> wrote:
> Dear GHC hackers,
> On our work on the new front-end AST for GHC  based on TTG , we
> would like to use a pattern synonym like the following :
> pattern LL :: HasSrcSpan a => SrcSpan -> SrcSpanLess a -> a
> pattern LL s m <- (decomposeSrcSpan -> (m , s))
> LL s m = composeSrcSpan (m , s)
> We know that any match on `LL` patterns, makes the pattern matching
> total, as it uses a view pattern with a total output pattern (i.e., in
> `decomposeSrcSpan -> (m , s)`, the pattern `(m , s)` is total).
> As far as I understand, currently COMPLETE pragmas cannot be used with
> such a polymorphic pattern.
> What do you suggest us to do to avoid the false incomplete pattern
> matching warnings?
>  https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow
>  https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow/TreesThatGrowGuidance
>  https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow/HandlingSourceLocations
> ghc-devs mailing list
> ghc-devs at haskell.org
More information about the ghc-devs