-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add COMPLETE pragmas for the pattern synonyms #336
Conversation
COMPLETE pragmas cause warnings on older GHCs, which support pattern synonyms but not COMPLETE pragma. I'd guard them with CPP:
EDIT: looks like COMPLETE pragmas was added in GHC-8.2: https://downloads.haskell.org/~ghc/8.2.2/docs/html/users_guide/8.2.1-notes.html#language |
81f26e3
to
45154f5
Compare
@@ -558,6 +558,9 @@ instance Functor (Fun a) where | |||
pattern Fn :: (a -> b) -> Fun a b | |||
#endif | |||
pattern Fn f <- (applyFun -> f) | |||
#if __GLASGOW_HASKELL__ >= 802 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Thanks @ilkecan! |
Hi. Without the added
COMPLETE
pragmas1, usage ofFn
,Fn2
orFn3
result in a warning such asif
-Wincomplete-patterns
is enabled.Footnotes
https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/pragmas.html#complete-pragmas ↩