testGroup "Fn" [
, testProperty "test" $
\(u :: ()) (QC.Fn f :: Fun () ()) -> f u
, testProperty "test2" $
\(u :: ()) (QC.Fn2 f :: Fun ((), ()) ()) -> f u u
, testProperty "test3" $
\(u :: ()) (QC.Fn3 f :: Fun ((), (), ()) ()) -> f u u u
]
Compiling this snippet results in GHC spitting out warnings:
tests/Properties/HashMapLazy.hs:484:7-46: warning: [-Wincomplete-uni-patterns]
Pattern match(es) are non-exhaustive
In a lambda abstraction:
Patterns of type ‘()’, ‘Fun () ()’ not matched: () (QC.Fun _ _)
|
484 | \(u :: ()) (QC.Fn f :: Fun () ()) -> f u
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/Properties/HashMapLazy.hs:486:7-55: warning: [-Wincomplete-uni-patterns]
Pattern match(es) are non-exhaustive
In a lambda abstraction:
Patterns of type ‘()’, ‘Fun ((), ()) ()’ not matched:
() (QC.Fun _ _)
|
486 | \(u :: ()) (QC.Fn2 f :: Fun ((), ()) ()) -> f u u
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/Properties/HashMapLazy.hs:488:7-61: warning: [-Wincomplete-uni-patterns]
Pattern match(es) are non-exhaustive
In a lambda abstraction:
Patterns of type ‘()’, ‘Fun ((), (), ()) ()’ not matched:
() (QC.Fun _ _)
|
488 | \(u :: ()) (QC.Fn3 f :: Fun ((), (), ()) ()) -> f u u u
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This is with GHC-9.2, where -Wincomplete-uni-patterns is included in -Wall. Older GHC versions don't complain unless -Wincomplete-uni-patterns is explicitly enabled.
I suspect that adding COMPLETE pragmas might silence such warnings. Does that seem like a good idea?!
Or is GHC simply misbehaving here?!
As a workaround I can use {-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-} in my relevant test modules for now.
(CC @Icelandjack who introduced these pattern synonyms in #111)
Compiling this snippet results in GHC spitting out warnings:
This is with GHC-9.2, where
-Wincomplete-uni-patterns
is included in-Wall
. Older GHC versions don't complain unless-Wincomplete-uni-patterns
is explicitly enabled.I suspect that adding
COMPLETE
pragmas might silence such warnings. Does that seem like a good idea?!Or is GHC simply misbehaving here?!
As a workaround I can use
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
in my relevant test modules for now.(CC @Icelandjack who introduced these pattern synonyms in #111)