From 22b1860379a81540e8bdf8c5d1473ab1b7acc950 Mon Sep 17 00:00:00 2001 From: Daniil Iaitskov Date: Wed, 10 Apr 2024 14:12:38 -0400 Subject: [PATCH] ghc911 pattern match ArgPat --- System/Console/CmdArgs/Quote.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/System/Console/CmdArgs/Quote.hs b/System/Console/CmdArgs/Quote.hs index e26848c..af3caef 100644 --- a/System/Console/CmdArgs/Quote.hs +++ b/System/Console/CmdArgs/Quote.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE TemplateHaskell, PatternGuards, MagicHash #-} +{-# LANGUAGE TemplateHaskell, PatternGuards, MagicHash, CPP #-} -- | This module provides a quotation feature to let you write command line -- arguments in the impure style, but have them translated into the pure style, @@ -150,7 +150,11 @@ rename = transformBi f simplify :: [Dec] -> [Dec] simplify = transformBi f where +#if MIN_VERSION_template_haskell(2,22,0) + f (AppE (LamE [VisAP (VarP v)] bod) x) = f $ subst v x bod +#else f (AppE (LamE [VarP v] bod) x) = f $ subst v x bod +#endif f x = x subst v x bod = transform f bod