From d0b5ebdd3638d9823d690a142845921bc1ed1d17 Mon Sep 17 00:00:00 2001 From: Janus Troelsen Date: Mon, 17 Nov 2025 15:18:27 -0600 Subject: [PATCH 1/2] Avoid overriding Monad(return) when unnecessary --- xml-hamlet/Text/Hamlet/XMLParse.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xml-hamlet/Text/Hamlet/XMLParse.hs b/xml-hamlet/Text/Hamlet/XMLParse.hs index d5a4e5c..6d0cdf8 100644 --- a/xml-hamlet/Text/Hamlet/XMLParse.hs +++ b/xml-hamlet/Text/Hamlet/XMLParse.hs @@ -22,7 +22,9 @@ import Text.ParserCombinators.Parsec hiding (Line) 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 MonadFail Result where instance Functor Result where fmap = liftM instance Applicative Result where - pure = return + pure = Ok (<*>) = ap data Content = ContentRaw String From 8d6bd98ed076a0c250a665b345caf60807fdf345 Mon Sep 17 00:00:00 2001 From: Janus Troelsen Date: Mon, 17 Nov 2025 15:18:42 -0600 Subject: [PATCH 2/2] Allow shakespeare-2.2 --- xml-hamlet/xml-hamlet.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xml-hamlet/xml-hamlet.cabal b/xml-hamlet/xml-hamlet.cabal index 8aed7bc..bd81fe1 100644 --- a/xml-hamlet/xml-hamlet.cabal +++ b/xml-hamlet/xml-hamlet.cabal @@ -18,7 +18,7 @@ Library 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