]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - Network/HTTP/Lucu/MIMEType/Guess.hs
Code clean-up using convertible-text.
[Lucu.git] / Network / HTTP / Lucu / MIMEType / Guess.hs
index edf177276eecc6feaf98be043ce13f96b3083e0d..6a791e4d15792a5aaff5a4504ceb6e10930e7a22 100644 (file)
@@ -17,8 +17,8 @@ module Network.HTTP.Lucu.MIMEType.Guess
     )
     where
 import Control.Applicative
-import Data.Attoparsec.Char8 as P
-import Data.Attoparsec.Lazy as LP
+import Data.Attoparsec.Char8
+import qualified Data.Attoparsec.Lazy as LP
 import qualified Data.ByteString.Lazy.Char8 as Lazy
 import qualified Data.Map as M
 import Data.Map (Map)
@@ -32,8 +32,8 @@ import Data.Text.Encoding
 import Language.Haskell.TH.Syntax
 import Language.Haskell.TH.Quote
 import Network.HTTP.Lucu.MIMEType
+import Network.HTTP.Lucu.OrphanInstances ()
 import Network.HTTP.Lucu.Parser
-import Network.HTTP.Lucu.Utils
 import Prelude.Unicode
 import System.FilePath
 
@@ -43,8 +43,7 @@ newtype ExtMap
     deriving (Eq, Show, Read, Monoid, Typeable)
 
 instance Lift ExtMap where
-    lift (ExtMap m)
-        = [| ExtMap $(liftMap liftText lift m) |]
+    lift (ExtMap m) = [| ExtMap $(lift m) |]
 
 -- |'QuasiQuoter' for 'ExtMap' reading Apache @mime.types@.
 --
@@ -104,7 +103,7 @@ parseExtMap src
              "pair"
 
       ext ∷ Parser Text
-      ext = (decodeUtf8 <$> P.takeWhile1 isAlphaNum)
+      ext = (decodeUtf8 <$> takeWhile1 isAlphaNum)
             <?>
             "ext"
 
@@ -118,7 +117,7 @@ parseExtMap src
             "linebreak"
 
 compile ∷ Ord k ⇒ [(v, [k])] → Either (k, v, v) (Map k v)
-compile = go (∅) ∘ concat ∘ map tr
+compile = go (∅) ∘ concat ∘ (tr <$>)
     where
       tr ∷ (v, [k]) → [(k, v)]
       tr (v, ks) = [(k, v) | k ← ks]