Dear GHC hackers,

On our work on the new front-end AST for GHC [0] based on TTG [1], we
would like to use a pattern synonym like the following [2]:

{{{
pattern LL :: HasSrcSpan a => SrcSpan -> SrcSpanLess a -> a
pattern LL s m <- (decomposeSrcSpan -> (m , s))
  where
            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?

Thanks,
  Shayan

[0] https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow
[1] 
https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow/TreesThatGrowGuidance
[2] 
https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow/HandlingSourceLocations
_______________________________________________
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Reply via email to