diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
 # Revision history for hpath-directory
 
+## 0.14.2.2 -- 2021-08-16
+
+- Fix hpath-directory for base < 4.13
+
 ## 0.14.2.1 -- 2021-08-12
 
 - Make compatible with streamly 0.8.0
diff --git a/hpath-directory.cabal b/hpath-directory.cabal
--- a/hpath-directory.cabal
+++ b/hpath-directory.cabal
@@ -1,7 +1,7 @@
 cabal-version:       >=1.10
 
 name:                hpath-directory
-version:             0.14.2.1
+version:             0.14.2.2
 synopsis:            Alternative to 'directory' package with ByteString based filepaths
 description:         This provides a safer alternative to the 'directory'
                      package. FilePaths are ByteString based, so this
diff --git a/src/System/Posix/RawFilePath/Directory.hs b/src/System/Posix/RawFilePath/Directory.hs
--- a/src/System/Posix/RawFilePath/Directory.hs
+++ b/src/System/Posix/RawFilePath/Directory.hs
@@ -103,6 +103,11 @@
                                                 , throwIO
                                                 , finally
                                                 )
+#if MIN_VERSION_base(4,9,0)
+import qualified Control.Monad.Fail             as Fail
+#else
+import qualified Control.Monad                  as Fail
+#endif
 import           Control.Monad                  ( unless
                                                 , void
                                                 , when
@@ -320,10 +325,14 @@
   unless (null collectedExceptions)
          (throwIO . RecursiveFailure $ collectedExceptions)
  where
-  basename :: MonadFail m => RawFilePath -> m RawFilePath
+#if MIN_VERSION_base(4,9,0)
+  basename :: Fail.MonadFail m => RawFilePath -> m RawFilePath
+#else
+  basename :: Fail.Monad m => RawFilePath -> m RawFilePath
+#endif
   basename x =
     let b = takeBaseName x
-    in  if BS.null b then fail ("No base name" :: String) else pure b
+    in  if BS.null b then Fail.fail ("No base name" :: String) else pure b
 
   go :: IORef [(RecursiveFailureHint, IOException)]
      -> RawFilePath
