diff --git a/Text/Hamlet/XMLParse.hs b/Text/Hamlet/XMLParse.hs
--- a/Text/Hamlet/XMLParse.hs
+++ b/Text/Hamlet/XMLParse.hs
@@ -22,7 +22,9 @@
 data Result v = Error String | Ok v
     deriving (Show, Eq, Read, Data, Typeable)
 instance Monad Result where
-    return = Ok
+#if !MIN_VERSION_base(4,8,0)
+    return = pure
+#endif
     Error s >>= _ = Error s
     Ok v >>= f = f v
 #if MIN_VERSION_base(4,13,0)
@@ -32,7 +34,7 @@
 instance Functor Result where
     fmap = liftM
 instance Applicative Result where
-    pure = return
+    pure = Ok
     (<*>) = ap
 
 data Content = ContentRaw String
diff --git a/xml-hamlet.cabal b/xml-hamlet.cabal
--- a/xml-hamlet.cabal
+++ b/xml-hamlet.cabal
@@ -1,6 +1,6 @@
 Cabal-version:       >=1.10
 Name:                xml-hamlet
-Version:             0.5.0.2
+Version:             0.5.0.3
 Synopsis:            Hamlet-style quasiquoter for XML content
 Homepage:            http://www.yesodweb.com/
 License:             BSD3
@@ -18,7 +18,7 @@
   Other-modules:       Text.Hamlet.XMLParse
   
   Build-depends:       base                       >= 4.12     && < 5
-                     , shakespeare                >= 1.0      && < 2.2
+                     , shakespeare                >= 1.0      && < 2.3
                      , xml-conduit                >= 1.0
                      , text                       >= 0.10
                      , template-haskell
