mirror of
https://github.com/polysemy-research/polysemy.git
synced 2024-12-02 11:54:06 +03:00
Ifdef away warnings that only occur on ghc>=8.8
This commit is contained in:
parent
28246caa6c
commit
013bf97f77
@ -1,4 +1,5 @@
|
||||
{-# LANGUAGE AllowAmbiguousTypes #-}
|
||||
{-# LANGUAGE CPP #-}
|
||||
{-# LANGUAGE FlexibleInstances #-}
|
||||
{-# LANGUAGE MonoLocalBinds #-}
|
||||
{-# LANGUAGE MultiParamTypeClasses #-}
|
||||
@ -40,6 +41,9 @@ module Polysemy.Internal
|
||||
|
||||
import Control.Applicative
|
||||
import Control.Monad
|
||||
#if __GLASGOW_HASKELL__ < 808
|
||||
import Control.Monad.Fail
|
||||
#endif
|
||||
import Control.Monad.Fix
|
||||
import Control.Monad.IO.Class
|
||||
import Data.Functor.Identity
|
||||
|
@ -265,13 +265,20 @@ decomp (Union p a) =
|
||||
-- | Retrieve the last effect in a 'Union'.
|
||||
extract :: Union '[e] m a -> Weaving e m a
|
||||
extract (Union Here a) = a
|
||||
#if __GLASGOW_HASKELL__ < 808
|
||||
extract (Union (There g) _) = case g of {}
|
||||
#endif
|
||||
{-# INLINE extract #-}
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
-- | An empty union contains nothing, so this function is uncallable.
|
||||
absurdU :: Union '[] m a -> b
|
||||
#if __GLASGOW_HASKELL__ < 808
|
||||
absurdU (Union pr _) = case pr of {}
|
||||
#else
|
||||
absurdU = \case {}
|
||||
#endif
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user