]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - Network/HTTP/Lucu/MIMEType/Guess.hs
many changes...
[Lucu.git] / Network / HTTP / Lucu / MIMEType / Guess.hs
index 3344f4b7351f1d545dc5a908f40457f65ad34cfe..226e01483cb233ecf88be8b0e0871f71678e3058 100644 (file)
@@ -115,11 +115,11 @@ serializeExtMap extMap moduleName variableName
                                   [] (HsUnGuardedRhs extMapExp) []]
                      ]
           extMapExp = HsApp (HsVar (Qual (Module "M") (HsIdent "fromList"))) (HsList records)
-          comment   =    "{- !!! WARNING !!!\n"
-                      ++ "   This file is automatically generated.\n"
-                      ++ "   DO NOT EDIT BY HAND OR YOU WILL REGRET -}\n\n"
+          comment   =   "{- !!! WARNING !!!\n"
+                       "   This file is automatically generated.\n"
+                       "   DO NOT EDIT BY HAND OR YOU WILL REGRET -}\n\n"
       in
-        comment ++ prettyPrint hsModule ++ "\n"
+        comment ⧺ prettyPrint hsModule ⧺ "\n"
     where
       records ∷ [HsExp]
       records = map record $ M.assocs extMap
@@ -137,4 +137,7 @@ serializeExtMap extMap moduleName variableName
           = HsApp (HsVar (UnQual (HsIdent "parseMIMEType")))
             (HsParen
              (HsApp (HsVar (Qual (Module "A") (HsIdent "unsafeFromString")))
-              (HsLit (HsString $ A.toString $ printMIMEType mt))))
+              (HsLit (HsString $ mimeToString mt))))
+
+      mimeToString ∷ MIMEType → String
+      mimeToString = A.toString ∘ A.fromAsciiBuilder ∘ printMIMEType