]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - Network/HTTP/Lucu/Implant/PrettyPrint.hs
MIMEParams is now an instance of collections-api's type classes.
[Lucu.git] / Network / HTTP / Lucu / Implant / PrettyPrint.hs
index ecdb4fe8aed35dacc39f1f4234060d366cc1a070..fa842a174f53989b6f286fe0fb2cf9b18c2297ec 100644 (file)
@@ -18,8 +18,8 @@ import Data.Ascii (CIAscii)
 import qualified Data.Ascii as A
 import qualified Data.ByteString.Lazy as L
 import Data.Char
-import Data.Foldable
-import Data.List
+import Data.Collections
+import Data.List (intersperse)
 import Data.Ratio
 import Data.Time
 import Language.Haskell.TH.Lib
@@ -30,8 +30,9 @@ import Network.HTTP.Lucu.ETag
 import Network.HTTP.Lucu.Implant
 import Network.HTTP.Lucu.Implant.Rewrite
 import Network.HTTP.Lucu.MIMEType
+import Network.HTTP.Lucu.OrphanInstances ()
 import Network.HTTP.Lucu.Resource
-import Network.HTTP.Lucu.Utils
+import Prelude hiding (head)
 import Prelude.Unicode
 
 header ∷ Input → Doc
@@ -79,8 +80,8 @@ moduleDecl modName symName
                    , text "where"
                    ])
 
-importDecls ∷ Imports ImportOp → Doc
-importDecls = vcat ∘ map pprImport ∘ toList
+importDecls ∷ Imports → Doc
+importDecls = vcat ∘ map pprImport ∘ fromFoldable
 
 pprImport ∷ ImportOp → Doc
 pprImport (QualifiedImp {..})
@@ -100,7 +101,7 @@ pprImport (UnqualifiedImp {impNames = Just ns, ..})
            , hcat [ lparen
                   , sep $ punctuate comma
                         $ map (uncurry pprImpName)
-                        $ toList ns
+                        $ fromFoldable ns
                   , rparen
                   ]
            ]
@@ -145,7 +146,7 @@ resourceDecl i symName
       decls ∷ [Q Dec]
       decls | useGZip i
                 = [ sigD gzipEncoding [t| CIAscii |]
-                  , valD (varP gzipEncoding) (normalB (liftCIAscii "gzip")) []
+                  , valD (varP gzipEncoding) (normalB (lift ("gzip" ∷ CIAscii))) []
                   ]
             | otherwise
                 = []
@@ -203,7 +204,7 @@ eTagDecl (Input {..})
 lastModDecl ∷ Input → Q [Dec]
 lastModDecl (Input {..})
     = sequence [ sigD lastModified [t| UTCTime |]
-               , valD (varP lastModified) (normalB (liftUTCTime iLastMod)) []
+               , valD (varP lastModified) (normalB (lift iLastMod)) []
                ]
 
 contTypeDecl ∷ Input → Q [Dec]
@@ -216,11 +217,11 @@ binDecl ∷ Input → Q [Dec]
 binDecl i@(Input {..})
     | useGZip i
         = sequence [ sigD gzippedData [t| L.ByteString |]
-                   , valD (varP gzippedData) (normalB (liftLazyByteString iGZipped)) []
+                   , valD (varP gzippedData) (normalB (lift iGZipped)) []
                    ]
     | otherwise
         = sequence [ sigD rawData [t| L.ByteString |]
-                   , valD (varP rawData) (normalB (liftLazyByteString iRawData)) []
+                   , valD (varP rawData) (normalB (lift iRawData)) []
                    ]
 
 rules ∷ Rules