Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion System/Console/CmdArgs/Quote.hs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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
Expand Down