From efb95667290c0257a1cccb74a26e227824e49b31 Mon Sep 17 00:00:00 2001 From: Torsten Schmits Date: Sat, 25 May 2024 20:19:42 +0200 Subject: [PATCH] avoid warning for absurdU with cpp --- src/Polysemy/Internal/Union.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Polysemy/Internal/Union.hs b/src/Polysemy/Internal/Union.hs index 209c6ec8..f0696838 100644 --- a/src/Polysemy/Internal/Union.hs +++ b/src/Polysemy/Internal/Union.hs @@ -295,7 +295,11 @@ extract (Union (There _) _) = error "Unsafe use of UnsafeMkElemOf" ------------------------------------------------------------------------------ -- | An empty union contains nothing, so this function is uncallable. absurdU :: Union '[] m a -> b -absurdU (Union _ _) = error "Unsafe use of UnsafeMkElemOf" +#if __GLASGOW_HASKELL__ >= 902 +absurdU = \case +#else +absurdU _ = error "Unsafe use of UnsafeMkElemOf" +#endif ------------------------------------------------------------------------------