diff --git a/CHANGELOG.markdown b/CHANGELOG.markdown
--- a/CHANGELOG.markdown
+++ b/CHANGELOG.markdown
@@ -1,3 +1,7 @@
+1.21.6 [2021.07.05]
+-------------------
+* Fix a build error when configured with `-template-haskell`.
+
 1.21.5 [2021.02.18]
 -------------------
 * Allow building with `lens-5.*`.
diff --git a/linear.cabal b/linear.cabal
--- a/linear.cabal
+++ b/linear.cabal
@@ -1,6 +1,6 @@
 name:          linear
 category:      Math, Algebra
-version:       1.21.5
+version:       1.21.6
 license:       BSD3
 cabal-version: >= 1.10
 license-file:  LICENSE
@@ -21,8 +21,9 @@
              , GHC == 8.2.2
              , GHC == 8.4.4
              , GHC == 8.6.5
-             , GHC == 8.8.3
-             , GHC == 8.10.1
+             , GHC == 8.8.4
+             , GHC == 8.10.4
+             , GHC == 9.0.1
 extra-source-files:
   .gitignore
   .hlint.yaml
diff --git a/src/Linear/Covector.hs b/src/Linear/Covector.hs
--- a/src/Linear/Covector.hs
+++ b/src/Linear/Covector.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, FlexibleContexts #-}
+{-# LANGUAGE CPP, MultiParamTypeClasses, FlexibleInstances, FlexibleContexts #-}
 -----------------------------------------------------------------------------
 -- |
 -- License     :  BSD-style (see the file LICENSE)
@@ -44,7 +44,9 @@
   Covector m >>- f = Covector $ \k -> m $ \a -> runCovector (f a) k
 
 instance Monad (Covector r) where
+#if !(MIN_VERSION_base(4,11,0))
   return a = Covector $ \k -> k a
+#endif
   Covector m >>= f = Covector $ \k -> m $ \a -> runCovector (f a) k
 
 instance Num r => Alt (Covector r) where
diff --git a/src/Linear/Matrix.hs b/src/Linear/Matrix.hs
--- a/src/Linear/Matrix.hs
+++ b/src/Linear/Matrix.hs
@@ -78,7 +78,7 @@
 -- >>> import Linear.V2
 -- >>> import Linear.V3
 -- >>> import Linear.V
--- >>> import Data.IntMap
+-- >>> import qualified Data.IntMap as IntMap
 -- >>> import Debug.SimpleReflect.Vars
 
 -- | This is a generalization of 'Control.Lens.inside' to work over any corepresentable 'Functor'.
@@ -106,7 +106,7 @@
 -- >>> V2 (V3 1 2 3) (V3 4 5 6) !*! V3 (V2 1 2) (V2 3 4) (V2 4 5)
 -- V2 (V2 19 25) (V2 43 58)
 --
--- >>> V2 (fromList [(1,2)]) (fromList [(2,3)]) !*! fromList [(1,V3 0 0 1), (2, V3 0 0 5)]
+-- >>> V2 (IntMap.fromList [(1,2)]) (IntMap.fromList [(2,3)]) !*! IntMap.fromList [(1,V3 0 0 1), (2, V3 0 0 5)]
 -- V2 (V3 0 0 2) (V3 0 0 15)
 (!*!) :: (Functor m, Foldable t, Additive t, Additive n, Num a) => m (t a) -> t (n a) -> m (n a)
 f !*! g = fmap (\ f' -> Foldable.foldl' (^+^) zero $ liftI2 (*^) f' g) f
diff --git a/src/Linear/Plucker.hs b/src/Linear/Plucker.hs
--- a/src/Linear/Plucker.hs
+++ b/src/Linear/Plucker.hs
@@ -95,7 +95,7 @@
 #if __GLASGOW_HASKELL__ >= 706
 import GHC.Generics (Generic1)
 #endif
-#if __GLASGOW_HASKELL__ >= 800
+#if __GLASGOW_HASKELL__ >= 800 && defined(MIN_VERSION_template_haskell)
 import Language.Haskell.TH.Syntax (Lift)
 #endif
 import Linear.Epsilon
@@ -117,7 +117,7 @@
 #if __GLASGOW_HASKELL__ >= 706
                                                     ,Generic1
 #endif
-#if __GLASGOW_HASKELL__ >= 800
+#if __GLASGOW_HASKELL__ >= 800 && defined(MIN_VERSION_template_haskell)
                                                     ,Lift
 #endif
                                                     )
@@ -180,8 +180,10 @@
   {-# INLINE (>>-) #-}
 
 instance Monad Plucker where
+#if !(MIN_VERSION_base(4,11,0))
   return a = Plucker a a a a a a
   {-# INLINE return #-}
+#endif
   Plucker a b c d e f >>= g = Plucker a' b' c' d' e' f' where
     Plucker a' _ _ _ _ _ = g a
     Plucker _ b' _ _ _ _ = g b
diff --git a/src/Linear/Quaternion.hs b/src/Linear/Quaternion.hs
--- a/src/Linear/Quaternion.hs
+++ b/src/Linear/Quaternion.hs
@@ -103,7 +103,7 @@
 #if __GLASGOW_HASKELL__ >= 706
 import GHC.Generics (Generic1)
 #endif
-#if __GLASGOW_HASKELL__ >= 800
+#if __GLASGOW_HASKELL__ >= 800 && defined(MIN_VERSION_template_haskell)
 import Language.Haskell.TH.Syntax (Lift)
 #endif
 import Linear.Epsilon
@@ -128,7 +128,7 @@
 #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 706
                              ,Generic1
 #endif
-#if __GLASGOW_HASKELL__ >= 800
+#if __GLASGOW_HASKELL__ >= 800 && defined(MIN_VERSION_template_haskell)
                              ,Lift
 #endif
                              )
diff --git a/src/Linear/Trace.hs b/src/Linear/Trace.hs
--- a/src/Linear/Trace.hs
+++ b/src/Linear/Trace.hs
@@ -43,12 +43,11 @@
 import Data.Functor.Product
 import Data.Hashable
 import Data.HashMap.Lazy
-import Data.IntMap
-import Data.Map
+import Data.IntMap (IntMap)
+import Data.Map (Map)
 
 -- $setup
 -- >>> import Data.Complex
--- >>> import Data.IntMap
 -- >>> import Debug.SimpleReflect.Vars
 -- >>> import Linear.V2
 
diff --git a/src/Linear/V.hs b/src/Linear/V.hs
--- a/src/Linear/V.hs
+++ b/src/Linear/V.hs
@@ -310,8 +310,10 @@
   {-# INLINE (>>-) #-}
 
 instance Dim n => Monad (V n) where
+#if !(MIN_VERSION_base(4,11,0))
   return = V . V.replicate (reflectDim (Proxy :: Proxy n))
   {-# INLINE return #-}
+#endif
   V as >>= f = V $ V.generate (reflectDim (Proxy :: Proxy n)) $ \i ->
     toVector (f (as `V.unsafeIndex` i)) `V.unsafeIndex` i
   {-# INLINE (>>=) #-}
diff --git a/src/Linear/V0.hs b/src/Linear/V0.hs
--- a/src/Linear/V0.hs
+++ b/src/Linear/V0.hs
@@ -84,7 +84,7 @@
 #if __GLASGOW_HASKELL__ >= 706
 import GHC.Generics (Generic1)
 #endif
-#if __GLASGOW_HASKELL__ >= 800
+#if __GLASGOW_HASKELL__ >= 800 && defined(MIN_VERSION_template_haskell)
 import Language.Haskell.TH.Syntax (Lift)
 #endif
 import qualified Data.Vector.Generic.Mutable as M
@@ -120,7 +120,7 @@
 #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 706
                         ,Generic1
 #endif
-#if __GLASGOW_HASKELL__ >= 800
+#if __GLASGOW_HASKELL__ >= 800 && defined(MIN_VERSION_template_haskell)
                         ,Lift
 #endif
                         )
@@ -204,8 +204,10 @@
   {-# INLINE (>>-) #-}
 
 instance Monad V0 where
+#if !(MIN_VERSION_base(4,11,0))
   return _ = V0
   {-# INLINE return #-}
+#endif
   V0 >>= _ = V0
   {-# INLINE (>>=) #-}
 
diff --git a/src/Linear/V1.hs b/src/Linear/V1.hs
--- a/src/Linear/V1.hs
+++ b/src/Linear/V1.hs
@@ -88,7 +88,7 @@
 #if __GLASGOW_HASKELL__ >= 706
 import GHC.Generics (Generic1)
 #endif
-#if __GLASGOW_HASKELL__ >= 800
+#if __GLASGOW_HASKELL__ >= 800 && defined(MIN_VERSION_template_haskell)
 import Language.Haskell.TH.Syntax (Lift)
 #endif
 import Linear.Metric
@@ -135,7 +135,7 @@
 #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 706
            ,Generic1
 #endif
-#if __GLASGOW_HASKELL__ >= 800
+#if __GLASGOW_HASKELL__ >= 800 && defined(MIN_VERSION_template_haskell)
            ,Lift
 #endif
            )
@@ -185,8 +185,10 @@
   {-# INLINE (>>-) #-}
 
 instance Monad V1 where
+#if !(MIN_VERSION_base(4,11,0))
   return = V1
   {-# INLINE return #-}
+#endif
   V1 a >>= f = f a
   {-# INLINE (>>=) #-}
 
diff --git a/src/Linear/V2.hs b/src/Linear/V2.hs
--- a/src/Linear/V2.hs
+++ b/src/Linear/V2.hs
@@ -92,7 +92,7 @@
 #if __GLASGOW_HASKELL__ >= 706
 import GHC.Generics (Generic1)
 #endif
-#if __GLASGOW_HASKELL__ >= 800
+#if __GLASGOW_HASKELL__ >= 800 && defined(MIN_VERSION_template_haskell)
 import Language.Haskell.TH.Syntax (Lift)
 #endif
 import qualified Data.Vector.Generic.Mutable as M
@@ -136,7 +136,7 @@
 #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 706
   ,Generic1
 #endif
-#if __GLASGOW_HASKELL__ >= 800
+#if __GLASGOW_HASKELL__ >= 800 && defined(MIN_VERSION_template_haskell)
   ,Lift
 #endif
   )
@@ -219,8 +219,10 @@
   {-# INLINE (>>-) #-}
 
 instance Monad V2 where
+#if !(MIN_VERSION_base(4,11,0))
   return a = V2 a a
   {-# INLINE return #-}
+#endif
   V2 a b >>= f = V2 a' b' where
     V2 a' _ = f a
     V2 _ b' = f b
diff --git a/src/Linear/V3.hs b/src/Linear/V3.hs
--- a/src/Linear/V3.hs
+++ b/src/Linear/V3.hs
@@ -93,7 +93,7 @@
 #if __GLASGOW_HASKELL__ >= 706
 import GHC.Generics (Generic1)
 #endif
-#if __GLASGOW_HASKELL__ >= 800
+#if __GLASGOW_HASKELL__ >= 800 && defined(MIN_VERSION_template_haskell)
 import Language.Haskell.TH.Syntax (Lift)
 #endif
 import Linear.Epsilon
@@ -116,7 +116,7 @@
 #if __GLASGOW_HASKELL__ >= 706
                                  ,Generic1
 #endif
-#if __GLASGOW_HASKELL__ >= 800
+#if __GLASGOW_HASKELL__ >= 800 && defined(MIN_VERSION_template_haskell)
                                  ,Lift
 #endif
                                  )
@@ -190,8 +190,10 @@
   {-# INLINE (>>-) #-}
 
 instance Monad V3 where
+#if !(MIN_VERSION_base(4,11,0))
   return a = V3 a a a
   {-# INLINE return #-}
+#endif
   V3 a b c >>= f = V3 a' b' c' where
     V3 a' _ _ = f a
     V3 _ b' _ = f b
diff --git a/src/Linear/V4.hs b/src/Linear/V4.hs
--- a/src/Linear/V4.hs
+++ b/src/Linear/V4.hs
@@ -99,7 +99,7 @@
 #if __GLASGOW_HASKELL__ >= 706
 import GHC.Generics (Generic1)
 #endif
-#if __GLASGOW_HASKELL__ >= 800
+#if __GLASGOW_HASKELL__ >= 800 && defined(MIN_VERSION_template_haskell)
 import Language.Haskell.TH.Syntax (Lift)
 #endif
 import Linear.Epsilon
@@ -123,7 +123,7 @@
 #if __GLASGOW_HASKELL__ >= 706
                                     ,Generic1
 #endif
-#if __GLASGOW_HASKELL__ >= 800
+#if __GLASGOW_HASKELL__ >= 800 && defined(MIN_VERSION_template_haskell)
                                     ,Lift
 #endif
                                     )
@@ -200,8 +200,10 @@
   {-# INLINE (>>-) #-}
 
 instance Monad V4 where
+#if !(MIN_VERSION_base(4,11,0))
   return a = V4 a a a a
   {-# INLINE return #-}
+#endif
   V4 a b c d >>= f = V4 a' b' c' d' where
     V4 a' _ _ _ = f a
     V4 _ b' _ _ = f b
