Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion containers-tests/containers-tests.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ common deps
array >=0.4.0.0
, base >=4.10 && <5
, deepseq >=1.2 && <1.6
, template-haskell
if impl(ghc > 9.14)
build-depends: template-haskell-lift >= 0.1 && <0.2
elif impl(ghc)
build-depends: template-haskell

common warnings
ghc-options: -Werror=unused-top-binds
Expand Down
7 changes: 6 additions & 1 deletion containers/containers.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ Library
base >= 4.10 && < 5
, array >= 0.4.0.0
, deepseq >= 1.4.3.0 && < 1.6
if impl(ghc)
-- template-haskell-lift was added as a boot library in GHC-9.14
-- once we no longer wish to backport releases to older major releases,
-- this conditional can be dropped
if impl(ghc > 9.14)
build-depends: template-haskell-lift >= 0.1 && <0.2
elif impl(ghc)
build-depends: template-haskell
hs-source-dirs: src
ghc-options: -O2 -Wall
Expand Down
6 changes: 5 additions & 1 deletion containers/src/Data/Graph.hs
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,13 @@ import Data.Semigroup (Semigroup (..))
#ifdef __GLASGOW_HASKELL__
import GHC.Generics (Generic, Generic1)
import Data.Data (Data)
# if __GLASGOW_HASKELL__ >= 914
import Language.Haskell.TH.Lift (Lift(..))
# else
import Language.Haskell.TH.Syntax (Lift(..))
-- See Note [ Template Haskell Dependencies ]
import Language.Haskell.TH ()
# endif
#endif

-- Make sure we don't use Integer by mistake.
Expand Down Expand Up @@ -191,7 +195,7 @@ deriving instance Generic1 SCC
deriving instance Generic (SCC vertex)

-- There is no instance Lift (NonEmpty v) before template-haskell-2.15.
#if MIN_VERSION_template_haskell(2,15,0)
#if __GLASGOW_HASKELL__ > 808
-- | @since 0.6.6
deriving instance Lift vertex => Lift (SCC vertex)
#else
Expand Down
6 changes: 5 additions & 1 deletion containers/src/Data/IntMap/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,13 @@ import Data.Data (Data(..), Constr, mkConstr, constrIndex,
import qualified Data.Data as Data
import GHC.Exts (build)
import qualified GHC.Exts as GHCExts
import Language.Haskell.TH.Syntax (Lift)
# if __GLASGOW_HASKELL__ >= 914
import Language.Haskell.TH.Lift (Lift(..))
# else
import Language.Haskell.TH.Syntax (Lift(..))
-- See Note [ Template Haskell Dependencies ]
import Language.Haskell.TH ()
# endif
#endif
#if defined(__GLASGOW_HASKELL__) || defined(__MHS__)
import Text.Read
Expand Down
6 changes: 5 additions & 1 deletion containers/src/Data/IntSet/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,13 @@ import Data.Coerce (coerce)

#if __GLASGOW_HASKELL__
import qualified GHC.Exts
import Language.Haskell.TH.Syntax (Lift)
# if __GLASGOW_HASKELL__ >= 914
import Language.Haskell.TH.Lift (Lift(..))
# else
import Language.Haskell.TH.Syntax (Lift(..))
-- See Note [ Template Haskell Dependencies ]
import Language.Haskell.TH ()
# endif
#endif

import qualified Data.Foldable as Foldable
Expand Down
6 changes: 5 additions & 1 deletion containers/src/Data/Map/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -412,9 +412,13 @@ import Utils.Containers.Internal.BitUtil (wordSize)

#if __GLASGOW_HASKELL__
import GHC.Exts (build, lazy)
import Language.Haskell.TH.Syntax (Lift)
# if __GLASGOW_HASKELL__ >= 914
import Language.Haskell.TH.Lift (Lift(..))
# else
import Language.Haskell.TH.Syntax (Lift(..))
-- See Note [ Template Haskell Dependencies ]
import Language.Haskell.TH ()
# endif
# ifdef USE_MAGIC_PROXY
import GHC.Exts (Proxy#, proxy# )
# endif
Expand Down
7 changes: 6 additions & 1 deletion containers/src/Data/Sequence/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,13 @@ import Text.Read (Lexeme(Ident), lexP, parens, prec,
import GHC.Exts (build)
import Data.Data
import Data.String (IsString(..))
# if __GLASGOW_HASKELL__ >= 914
import qualified Language.Haskell.TH.Lift as TH
# else
import qualified Language.Haskell.TH.Syntax as TH
-- See Note [ Template Haskell Dependencies ]
import Language.Haskell.TH ()
# endif
import GHC.Generics (Generic, Generic1)

-- Array stuff, with GHC.Arr on GHC
Expand Down Expand Up @@ -330,7 +334,8 @@ newtype Seq a = Seq (FingerTree (Elem a))
#ifdef __GLASGOW_HASKELL__
-- | @since 0.6.6
instance TH.Lift a => TH.Lift (Seq a) where
# if MIN_VERSION_template_haskell(2,16,0)
-- template-haskell >= 2.16
# if __GLASGOW_HASKELL__ >= 810
liftTyped t = [|| coerceFT z ||]
# else
lift t = [| coerceFT z |]
Expand Down
8 changes: 6 additions & 2 deletions containers/src/Data/Set/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,14 @@ import Text.Read ( readPrec, Read (..), Lexeme (..), parens, prec
import GHC.Exts ( build, lazy )
import qualified GHC.Exts as GHCExts
import Data.Data
import Language.Haskell.TH.Syntax (Lift)
# if __GLASGOW_HASKELL__ >= 914
import Language.Haskell.TH.Lift (Lift(..))
# else
import Language.Haskell.TH.Syntax (Lift(..))
-- See Note [ Template Haskell Dependencies ]
import Language.Haskell.TH ()
import Data.Coerce (coerce)
# endif
import Data.Coerce
#endif


Expand Down
6 changes: 5 additions & 1 deletion containers/src/Data/Tree.hs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,13 @@ import Control.DeepSeq (NFData(rnf),NFData1(liftRnf))
import Data.Data (Data)
import GHC.Generics (Generic, Generic1)
import qualified GHC.Exts
import Language.Haskell.TH.Syntax (Lift)
# if __GLASGOW_HASKELL__ >= 914
import Language.Haskell.TH.Lift (Lift(..))
# else
import Language.Haskell.TH.Syntax (Lift(..))
-- See Note [ Template Haskell Dependencies ]
import Language.Haskell.TH ()
# endif
#endif

import Control.Monad.Zip (MonadZip (..))
Expand Down
Loading