diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+20 Feb 2025
+0.5.4 Release
+Merge Daniil's Itskov's changes:
+	Add files for building with nix
+	Build with ghc-9.10.1
+Remove tests for hCurry and hCompose where ghc-9.4.8 has poor type inference
+not seen in newer versions.
+
 23 Sep 2023
 0.5.3 Release
 Build with ghc-9.4.6 and ghc-9.6.1.
diff --git a/Data/HList/FakePrelude.hs b/Data/HList/FakePrelude.hs
--- a/Data/HList/FakePrelude.hs
+++ b/Data/HList/FakePrelude.hs
@@ -23,7 +23,9 @@
 #if __GLASGOW_HASKELL__ >= 800
 import qualified GHC.TypeLits as Data.HList.FakePrelude (ErrorMessage((:$$:), (:<>:))) -- XXX check this works?
 #endif
+#if __GLASGOW_HASKELL__ <= 906
 import Control.Applicative
+#endif
 #if NEW_TYPE_EQ
 import Data.Type.Equality (type (==))
 #endif
diff --git a/Data/HList/HList.hs b/Data/HList/HList.hs
--- a/Data/HList/HList.hs
+++ b/Data/HList/HList.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
 {- |
    The HList library
 
@@ -18,7 +19,10 @@
 import LensDefs
 
 import Data.Array (Ix)
+
+#if __GLASGOW_HASKELL__ <= 906
 import Data.Semigroup
+#endif
 
 -- --------------------------------------------------------------------------
 -- * Heterogeneous type sequences
@@ -171,10 +175,10 @@
     show _ = "H[]"
 
 instance (Show e, Show (HList l)) => Show (HList (e ': l)) where
-    show (HCons x l) = let 'H':'[':s = show l
-                       in "H[" ++ show x ++
-                                  (if s == "]" then s else "," ++ s)
-
+    show (HCons x l) =
+      case show l of
+        'H':'[':s -> "H[" ++ show x ++ (if s == "]" then s else "," ++ s)
+        s -> error $ "unreachable branch: " ++ show x ++ " " ++ s
 
 instance Read (HList '[]) where
     readsPrec _ str = case stripPrefix "H[]" str of
@@ -1629,7 +1633,9 @@
     HMapCxt HList UncurryMappend aa a) => Monoid (HList a) where
   mempty = hMap ConstMempty
             $ (hProxies :: HList (AddProxy a))
+#if __GLASGOW_HASKELL__ <= 906
   mappend a b = hMap UncurryMappend $ hZip a b
+#endif
 
 instance
     (HZip HList a a aa,
@@ -1649,4 +1655,3 @@
 data UncurrySappend = UncurrySappend
 instance (aa ~ (a,a), Semigroup a) => ApplyAB UncurrySappend aa a where
     applyAB _ = uncurry (<>)
-
diff --git a/Data/HList/HSort.hs b/Data/HList/HSort.hs
--- a/Data/HList/HSort.hs
+++ b/Data/HList/HSort.hs
@@ -77,6 +77,9 @@
 instance HEqByFn le => HIsAscList le '[x] True
 instance HEqByFn le => HIsAscList le '[] True
 instance (HEqBy le x y b1,
+#if __GLASGOW_HASKELL__ > 906
+         HEqByFn le,
+#endif
          HIsAscList le (y ': ys) b2,
          HAnd b1 b2 ~ b3)  => HIsAscList le (x ': y ': ys) b3
 
@@ -144,6 +147,9 @@
     hSort2 _ x y = y `HCons` x `HCons` HNil
 
 instance (HMerge le xs' ys' sorted,
+#if __GLASGOW_HASKELL__ > 906
+          HEqByFn le,
+#endif
           HMSortBy le ys ys',
           HMSortBy le xs xs',
           HLengthEq (a ': b ': c ': cs) n2,
@@ -241,7 +247,11 @@
 class HEqByFn le => HAscList0 le (ps :: [*]) (ps0 :: [*])
 
 class HEqByFn le => HAscList1 le (b :: Bool) (ps :: [*]) (ps0 :: [*])
-instance (HAscList1 le b (y ': ys) ps0, HEqBy le x y b)
+instance ( HAscList1 le b (y ': ys) ps0, HEqBy le x y b
+#if __GLASGOW_HASKELL__ > 906
+         , HEqByFn le
+#endif
+         )
   => HAscList0 le (x ': y ': ys) ps0
 instance HEqByFn le => HAscList0 le '[] ps0
 instance HEqByFn le => HAscList0 le '[x] ps0
diff --git a/Data/HList/Label5.hs b/Data/HList/Label5.hs
--- a/Data/HList/Label5.hs
+++ b/Data/HList/Label5.hs
@@ -3,6 +3,9 @@
 {-# LANGUAGE OverlappingInstances #-}
 {-# OPTIONS_GHC -fno-warn-unrecognised-pragmas #-}
 #endif
+#if __GLASGOW_HASKELL__ > 906
+{-# LANGUAGE LambdaCase #-}
+#endif
 {- |
    Description: labels are any instance of Typeable
 
@@ -33,7 +36,7 @@
 -- | Show label
 instance {-# OVERLAPPABLE #-} Typeable (x :: *) => ShowLabel x
  where
-  showLabel _ = (\(x:xs) -> toLower x:xs)
+  showLabel _ = (\l -> case l of [] -> [] ; (x:xs) -> toLower x:xs)
             . reverse
             . takeWhile (not . (==) '.')
             . reverse
diff --git a/Data/HList/Record.hs b/Data/HList/Record.hs
--- a/Data/HList/Record.hs
+++ b/Data/HList/Record.hs
@@ -198,8 +198,9 @@
 import LensDefs
 
 import Data.Array (Ix)
+#if __GLASGOW_HASKELL__ <= 906
 import Data.Semigroup (Semigroup)
-
+#endif
 -- imports for doctest/examples
 import Data.HList.Label6 ()
 import Data.HList.TypeEqO ()
diff --git a/Data/HList/TIC.hs b/Data/HList/TIC.hs
--- a/Data/HList/TIC.hs
+++ b/Data/HList/TIC.hs
@@ -24,8 +24,9 @@
 import Data.HList.HArray
 
 import Data.Array (Ix)
+#if __GLASGOW_HASKELL__ <= 906
 import Data.Semigroup (Semigroup)
-
+#endif
 import Text.ParserCombinators.ReadP
 import LensDefs
 
diff --git a/Data/HList/TIP.hs b/Data/HList/TIP.hs
--- a/Data/HList/TIP.hs
+++ b/Data/HList/TIP.hs
@@ -23,8 +23,9 @@
 import Data.HList.TIPtuple
 import Data.List (intercalate)
 import Data.Array (Ix)
+#if __GLASGOW_HASKELL__ <= 906
 import Data.Semigroup (Semigroup)
-
+#endif
 
 #if __GLASGOW_HASKELL__ > 710
 import Data.Coerce
diff --git a/Data/HList/Variant.hs b/Data/HList/Variant.hs
--- a/Data/HList/Variant.hs
+++ b/Data/HList/Variant.hs
@@ -28,8 +28,9 @@
 
 import Unsafe.Coerce
 import GHC.Exts (Constraint)
-
+#if __GLASGOW_HASKELL__ <= 906
 import Data.Semigroup (Semigroup( .. ))
+#endif
 import Data.Data
 import Control.Applicative
 import LensDefs
@@ -928,17 +929,21 @@
 -- * Monoid
 instance (Unvariant '[Tagged t x] x, Monoid x) => Monoid (Variant '[Tagged t x]) where
     mempty = mkVariant (Label :: Label t) mempty Proxy
+#if __GLASGOW_HASKELL__ <= 906
     mappend a b = case (unvariant a, unvariant b) of
                     (l, r) -> mkVariant (Label :: Label t) (mappend l r) Proxy
+#endif
 
 
 instance (Monoid x, Monoid (Variant (a ': b))) => Monoid (Variant (Tagged t x ': a ': b)) where
     mempty = extendVariant mempty
+#if __GLASGOW_HASKELL__ <= 906
     mappend a b = case (splitVariant1 a, splitVariant1 b) of
                     (Left l, Left r) -> mkVariant (Label :: Label t) (mappend l r) Proxy
                     (Left l, _) -> mkVariant (Label :: Label t) l Proxy
                     (_, Left r) -> mkVariant (Label :: Label t) r Proxy
                     (Right l, Right r) -> extendVariant $ mappend l r
+#endif
 
 -- * Projection
 
diff --git a/HList.cabal b/HList.cabal
--- a/HList.cabal
+++ b/HList.cabal
@@ -1,5 +1,5 @@
 Name:                HList
-Version:             0.5.3.0
+Version:             0.5.4.0
 Category:            Data
 Synopsis:            Heterogeneous lists
 Description:         HList provides many operations to create and manipulate
@@ -30,7 +30,7 @@
 
 Data-files:          README, ChangeLog
 Cabal-version:       >= 1.10
-Tested-With:         GHC==9.6.1
+Tested-With:         GHC==9.4.8, GHC==9.6.6, GHC==9.8.2, GHC==9.10.1
 Build-Type:          Simple
 
 Extra-Source-Files:
@@ -58,7 +58,7 @@
                See <https://ghc.haskell.org/trac/ghc/ticket/9918>
 
 library
-  Build-Depends:       base >= 4.6 && < 5,
+  Build-Depends:       base >= 4.6 && < 4.21,
                        -- for Typeable '[] and '(:) with ghc-7.6
                        base-orphans,
                        -- Data.Semigroup for ghc < 8
@@ -144,14 +144,14 @@
 
   if flag(new_type_eq)
     Cpp-options:       -DNEW_TYPE_EQ
-    Build-Depends:     base >= 4.7
+    Build-Depends:     base >= 4.7 && < 4.21
 
 Test-Suite examples
   Type:     exitcode-stdio-1.0
   Main-Is: HListExample.hs
   Default-Language:    Haskell2010
   Hs-Source-Dirs:  examples
-  Build-Depends:       base, hspec >= 1.7, directory, filepath,
+  Build-Depends:       base < 4.21, hspec >= 1.7, directory, filepath,
                        hspec-expectations,
                        process,
                        syb,
@@ -188,7 +188,7 @@
     -- depending on the ghc version, comes out as one of
     -- (Bounded a, Enum a) => ...
     -- (Enum b, Bounded b) => ...
-    Build-Depends: base, doctest >= 0.8, process
+    Build-Depends: base < 4.21, doctest >= 0.8, process
   Buildable: False
   Main-Is: rundoctests.hs
   Hs-Source-Dirs:  examples
@@ -197,7 +197,7 @@
 
 Test-Suite properties
   Type:     exitcode-stdio-1.0
-  Build-Depends: base,
+  Build-Depends: base < 4.21,
                  hspec >= 1.7,
                  hspec-expectations,
                  HList,
diff --git a/README b/README
--- a/README
+++ b/README
@@ -2,7 +2,7 @@
 
 Contributors:
 	Justin Bailey, Brian Bloniarz, Gwern Branwen, Einar Karttunen,
-	and Adam Vogt
+	Daniil Iaitskov and Adam Vogt
 
 
 The HList library and samples
@@ -46,20 +46,25 @@
 $ cd HList; cabal install
 
 The code was tested --- within the limits exercised in the source files ---
-with GHC:
-
-  - 9.2.0.20210821
-  - 9.0.1
-  - 8.10.6
-  - 8.8.4
-  - 8.6.5
-  - 8.4.4
-
-and may still work with GHC-7.6, 7.8, 7.10, 8.2
+with GHC 9.4.8 through 9.10.1 and it may still work older versions possibly back to
+GHC-7.6
 
 Older compilers are not supported.
 
 One may run "cabal test" to check the distribution.
 
-See ChangeLog for updates.
+----------------------------------------------------------------------
 
+The library can be built and tested in the checked environment (with
+compatible GHC, cabal and dependencies) provided by nix:
+
+$ nix-build        # builds and runs tests
+$ nix-shell --pure # drops into an isolated shell
+
+nix usually can be installed with a single line:
+
+$ sh <(curl -L https://nixos.org/nix/install) --no-daemon
+
+----------------------------------------------------------------------
+
+See ChangeLog for updates.
diff --git a/examples/HListExample/MainPosting051106.hs b/examples/HListExample/MainPosting051106.hs
--- a/examples/HListExample/MainPosting051106.hs
+++ b/examples/HListExample/MainPosting051106.hs
@@ -5,6 +5,10 @@
 {-# LANGUAGE EmptyDataDecls #-}
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE CPP #-}
+#if __GLASGOW_HASKELL__ > 906
+{-# LANGUAGE TypeOperators #-}
+#endif
 module HListExample.MainPosting051106 where
 
 -- Needed for a reply to the Haskell mailing list
@@ -131,17 +135,17 @@
 > Sent: Sunday, November 06, 2005 7:01 PM
 > To: haskell-cafe@haskell.org
 > Subject: [Haskell-cafe] Type classes and hFoldr from HList
-> 
-> 
+>
+>
 >   I was playing around with the HList library from the paper...
-> 
+>
 >     Strongly typed heterogeneous collections
 >     http://homepages.cwi.nl/~ralf/HList/
-> 
+>
 > ...and I thought I'd try to fold the composition function (.) through
 a
 > heterogeneous list of functions, using hFoldr...
-> 
+>
 > >{-# OPTIONS -fglasgow-exts #-}
 > >{-# OPTIONS -fallow-undecidable-instances #-}
 > >
@@ -158,9 +162,9 @@
 > >instance Apply (a -> b -> c -> d) (a, b) (c -> d)
 > >    where
 > >        apply f (a,b) = f a b
-> 
+>
 > ...but it fails with the following type error...
-> 
+>
 > ]Compiling Main             ( compose.hs, interpreted )
 > ]
 > ]compose.hs:10:7:
@@ -188,14 +192,14 @@
 > > c)
 > ]([a2] -> Int, a1 -> a1) r1)
 > ]    In the definition of `comp': comp = hFoldr (.) id test
-> 
+>
 > ...Anyway, I couldn't quite tell whether I was using hFoldr
 incorrectly,
 > or if I needed to have more constraints placed on the construction of
 > "test", or if needed some sort of type-level function that resolves...
-> 
+>
 > Apply ((b -> c) -> (a -> b) -> a -> c)
-> 
+>
 > ...into (a -> c), or something else altogether.  I figured someone
 might
 > be able to help point me in the right direction.
diff --git a/examples/Properties.hs b/examples/Properties.hs
--- a/examples/Properties.hs
+++ b/examples/Properties.hs
@@ -1,5 +1,9 @@
 {-# LANGUAGE CPP #-}
+#if __GLASGOW_HASKELL__ > 906
+{-# OPTIONS_GHC -freduction-depth=100 #-}
+#else
 {-# OPTIONS_GHC -fcontext-stack=100 #-}
+#endif
 {-# OPTIONS_GHC -fno-warn-deprecations #-} -- ghc-7.8 has no Typeable (x :: Symbol), so use OldTypeable
 {-# LANGUAGE QuasiQuotes #-}
 {-# LANGUAGE DataKinds #-}
@@ -33,11 +37,3 @@
    hl0
    hl1_2_3
    kwSpecs
-
-
-
-
-
-
-
-
diff --git a/examples/Properties/Common.hs b/examples/Properties/Common.hs
--- a/examples/Properties/Common.hs
+++ b/examples/Properties/Common.hs
@@ -145,9 +145,15 @@
 
 instance Monoid (BoolN n) where
     mempty = BoolN (getAll mempty)
+#if __GLASGOW_HASKELL__ <= 906
     mappend (BoolN x) (BoolN y) = BoolN (getAll (mappend (All x) (All y)))
 
 instance Semigroup (BoolN n) where (<>) = mappend
+#else
+
+instance Semigroup (BoolN n) where
+  (BoolN x) <> (BoolN y) = BoolN (getAll (mappend (All x) (All y)))
+#endif
 
 #if !MIN_VERSION_QuickCheck(2,9,0)
 instance Arbitrary (Identity (BoolN n)) where
diff --git a/examples/Properties/LengthDependent.hs b/examples/Properties/LengthDependent.hs
--- a/examples/Properties/LengthDependent.hs
+++ b/examples/Properties/LengthDependent.hs
@@ -16,6 +16,9 @@
 -- supplied HList isn't known until Properties.LengthDependentSplice)
 module Properties.LengthDependent where
 
+#if MIN_VERSION_base(4,9,0)
+import qualified Data.Kind as DK
+#endif
 
 import Data.HList.HSort (hMSortBy)
 import Data.HList.Variant (eqVariant)
@@ -91,7 +94,11 @@
 
           rss :: [TypeQ]
           rss = takeK $
+#if MIN_VERSION_base(4,9,0)
+                [ [t| (Record :: [DK.Type] -> DK.Type) $(hListT (map taggedN ns)) |]
+#else
                 [ [t| (Record :: [*] -> *) $(hListT (map taggedN ns)) |]
+#endif
                    | ns <- permutations [1 .. fromIntegral n] ]
 
           -- taggedN 1 == [t| Tagged 1 x1 |]
@@ -463,5 +470,3 @@
         ]
 #endif
   |]
-
-
diff --git a/examples/Properties/LengthDependentSplice.hs b/examples/Properties/LengthDependentSplice.hs
--- a/examples/Properties/LengthDependentSplice.hs
+++ b/examples/Properties/LengthDependentSplice.hs
@@ -1,4 +1,9 @@
-{-# OPTIONS_GHC -fcontext-stack=1000 #-}
+{-# LANGUAGE CPP #-}
+#if __GLASGOW_HASKELL__ > 906
+{-# OPTIONS_GHC -freduction-depth=100 #-}
+#else
+{-# OPTIONS_GHC -fcontext-stack=100 #-}
+#endif
 {-# LANGUAGE FlexibleContexts #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE RankNTypes #-}
diff --git a/examples/Properties/LengthIndependent.hs b/examples/Properties/LengthIndependent.hs
--- a/examples/Properties/LengthIndependent.hs
+++ b/examples/Properties/LengthIndependent.hs
@@ -575,7 +575,9 @@
     return $ conjoin
       [ hUncurry (,,) (hBuild vx vy vz) `eq` (vx,vy,vz),
         hCurry (hUncurry (,,)) vx vy vz `eq` (vx,vy,vz),
+#if __GLASGOW_HASKELL__ > 948
         hCurry (hUncurry id) vx `eq` vx,
+#endif
         hCurry ( \(a `HCons` b `HCons` HNil) -> (b,a)) vx vy `eq` (vy,vx)
       ]
 
@@ -584,9 +586,12 @@
     vy :: BoolN "y" <- arbitrary
     vz :: BoolN "z" <- arbitrary
     return $ conjoin
-      [ hCompose (,) (,) vx vy vz `eq` ((vx,vy), vz),
-        hCompose id (,) vx vy `eq` (vx,vy),
-        hCompose (,) id vx vy `eq` (vx,vy) ]
+      [ hCompose (,) (,) vx vy vz `eq` ((vx,vy), vz)
+        , hCompose id (,) vx vy `eq` (vx,vy),
+#if __GLASGOW_HASKELL__ > 948
+        , hCompose (,) id vx vy `eq` (vx,vy)
+#endif
+        ]
 
 
 hTuples = do
@@ -681,4 +686,3 @@
 v2 = fmap (`asLabelsOf` (Proxy :: Proxy '[Label "y"])) (projectVariant v)
 v_id = fmap (`asLabelsOf` v) (projectVariant v)
 v_id2 = fmap (`asLabelsOf` labelsOf v) (projectVariant v)
-
