diff options
Diffstat (limited to 'Build/EvilSplicer.hs')
-rw-r--r-- | Build/EvilSplicer.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Build/EvilSplicer.hs b/Build/EvilSplicer.hs index 1fd64670b..70fe2d5be 100644 --- a/Build/EvilSplicer.hs +++ b/Build/EvilSplicer.hs @@ -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 + . persist_dequalify_hack . remove_unnecessary_type_signatures . lambdaparenhack . lambdaparens @@ -554,6 +555,13 @@ mangleCode = flip_colon - The ; is added by case_layout. -} flip_colon = replace "; : _ " "; _ : " + {- TH for persistent has some qualified symbols in places + - that are not allowed. -} + persist_dequalify_hack = replace "Database.Persist.TH.++" "++" + . replace "Database.Persist.Sql.Class.sqlType" "sqlType" + . replace "Database.Persist.Class.PersistField.toPersistValue" "toPersistValue" + . replace "Database.Persist.Class.PersistField.fromPersistValue" "fromPersistValue" + {- Embedded files use unsafe packing, which is problimatic - for several reasons, including that GHC sometimes omits trailing - newlines in the file content, which leads to the wrong byte |