From c17b989a524ea9c44d5dac7b399151c3c4a7a6fc Mon Sep 17 00:00:00 2001 From: Johannes Waldmann Date: Fri, 15 Mar 2024 23:05:55 +0100 Subject: [PATCH] fix #194 --- xml-hamlet/Text/Hamlet/XML.hs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/xml-hamlet/Text/Hamlet/XML.hs b/xml-hamlet/Text/Hamlet/XML.hs index 9e3cf4f..399ffeb 100644 --- a/xml-hamlet/Text/Hamlet/XML.hs +++ b/xml-hamlet/Text/Hamlet/XML.hs @@ -151,7 +151,11 @@ docToExp scope (DocForall list idents inside) = do let scope' = extraScope ++ scope mh <- [|F.concatMap|] inside' <- docsToExp scope' inside +#if MIN_VERSION_template_haskell(2,22,0) + let lam = LamE [VisAP pat] inside' +#else let lam = LamE [pat] inside' +#endif return $ mh `AppE` lam `AppE` list' docToExp scope (DocWith [] inside) = docsToExp scope inside docToExp scope (DocWith ((deref, idents):dis) inside) = do @@ -159,14 +163,22 @@ docToExp scope (DocWith ((deref, idents):dis) inside) = do (pat, extraScope) <- bindingPattern idents let scope' = extraScope ++ scope inside' <- docToExp scope' (DocWith dis inside) +#if MIN_VERSION_template_haskell(2,22,0) + let lam = LamE [VisAP pat] inside' +#else let lam = LamE [pat] inside' +#endif return $ lam `AppE` deref' docToExp scope (DocMaybe val idents inside mno) = do let val' = derefToExp scope val (pat, extraScope) <- bindingPattern idents let scope' = extraScope ++ scope inside' <- docsToExp scope' inside +#if MIN_VERSION_template_haskell(2,22,0) + let inside'' = LamE [VisAP pat] inside' +#else let inside'' = LamE [pat] inside' +#endif ninside' <- case mno of Nothing -> [| [] |] Just no -> docsToExp scope no