aboutsummaryrefslogtreecommitdiff
path: root/Build/EvilSplicer.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-09-22 03:22:05 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-09-22 03:22:05 -0400
commitf7c420d9b893197b35da7a15e3384e26ef2d47fd (patch)
tree20a6545a863bb2a03e24f73d85c0d60b1ae0f039 /Build/EvilSplicer.hs
parent893abe5b247fc596f6cc8e5f6c41cc4deb49ac56 (diff)
another fine hack
Diffstat (limited to 'Build/EvilSplicer.hs')
-rw-r--r--Build/EvilSplicer.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/Build/EvilSplicer.hs b/Build/EvilSplicer.hs
index 8f203437a..d43b16a64 100644
--- a/Build/EvilSplicer.hs
+++ b/Build/EvilSplicer.hs
@@ -294,6 +294,7 @@ expandExpressionSplice s lls = concat [before, spliced:padding, end]
{- Tweaks code output by GHC in splices to actually build. Yipes. -}
mangleCode :: String -> String
mangleCode = flip_colon
+ . remove_unnecessary_type_signatures
. lambdaparens
. declaration_parens
. case_layout
@@ -439,6 +440,19 @@ mangleCode = flip_colon
- declarations. -}
declaration_parens = replace "StaticR Route Static" "StaticR (Route Static)"
+ {- A type signature is sometimes given for an entire lambda,
+ - which is not properly parenthesized or laid out. This is a
+ - hack to remove one specific case where this happens and the
+ - signature is easily inferred, so is just removed.
+ -}
+ remove_unnecessary_type_signatures = parsecAndReplace $ do
+ string " ::"
+ newline
+ many1 $ char ' '
+ string "Text.Css.Block Text.Css.Resolved"
+ newline
+ return ""
+
{- GHC may add full package and version qualifications for
- symbols from unimported modules. We don't want these.
-