put in hack for weird new problem with ghc's emitted splices
This commit is contained in:
parent
6c1ed6ed4b
commit
9b7fa4ad07
1 changed files with 6 additions and 0 deletions
|
@ -301,6 +301,7 @@ expandExpressionSplice sp lls = concat [before, spliced:padding, end]
|
|||
{- Tweaks code output by GHC in splices to actually build. Yipes. -}
|
||||
mangleCode :: String -> String
|
||||
mangleCode = flip_colon
|
||||
. remove_weird_string_hash
|
||||
. remove_unnecessary_type_signatures
|
||||
. lambdaparenhack
|
||||
. lambdaparens
|
||||
|
@ -549,6 +550,11 @@ mangleCode = flip_colon
|
|||
- The ; is added by case_layout. -}
|
||||
flip_colon = replace "; : _ " "; _ : "
|
||||
|
||||
{- Sometimes a string will end with ".."#, and the hash needs to be
|
||||
- removed.
|
||||
-}
|
||||
remove_weird_string_hash = replace "\"#" "#"
|
||||
|
||||
{- This works around a problem in the expanded template haskell for Yesod
|
||||
- type-safe url rendering.
|
||||
-
|
||||
|
|
Loading…
Add table
Reference in a new issue