X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=Network%2FHTTP%2FLucu%2FMIMEType%2FGuess.hs;h=226e01483cb233ecf88be8b0e0871f71678e3058;hb=3fe5ca3bca04e0124a5f2440e893dc5375e0bb51;hp=2319477f68dc3410fa69cbd6ae2cc5bce5173eea;hpb=360baa7e2cc4d4458481f3981d94e767a5ad4c02;p=Lucu.git diff --git a/Network/HTTP/Lucu/MIMEType/Guess.hs b/Network/HTTP/Lucu/MIMEType/Guess.hs index 2319477..226e014 100644 --- a/Network/HTTP/Lucu/MIMEType/Guess.hs +++ b/Network/HTTP/Lucu/MIMEType/Guess.hs @@ -1,6 +1,5 @@ {-# LANGUAGE BangPatterns - , UnboxedTuples , UnicodeSyntax #-} -- |MIME Type guessing by a file extension. This is a poor man's way @@ -116,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 @@ -138,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