X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=Network%2FHTTP%2FLucu%2FMIMEParams.hs;h=9c39236679feea13cabaaa94edd346684be9a810;hb=0d8f718f4c7babafab9ab11e78b58823b7682522;hp=b3edeb5836745779d8f2820eae92b90d19f98fcf;hpb=5e561403ba8ad9c440cc2bf2bacb61ebc3c7a111;p=Lucu.git diff --git a/Network/HTTP/Lucu/MIMEParams.hs b/Network/HTTP/Lucu/MIMEParams.hs index b3edeb5..9c39236 100644 --- a/Network/HTTP/Lucu/MIMEParams.hs +++ b/Network/HTTP/Lucu/MIMEParams.hs @@ -1,5 +1,6 @@ {-# LANGUAGE - DeriveDataTypeable + CPP + , DeriveDataTypeable , DoAndIfThenElse , GeneralizedNewtypeDeriving , OverloadedStrings @@ -45,7 +46,7 @@ import Network.HTTP.Lucu.Utils import Prelude hiding (concat, mapM, takeWhile) import Prelude.Unicode --- |A map from MIME parameter attributes to values. Attributes are +-- |A 'Map' from MIME parameter attributes to values. Attributes are -- always case-insensitive according to RFC 2045 -- (). newtype MIMEParams @@ -61,8 +62,11 @@ instance Lift MIMEParams where -- |Convert MIME parameter values to an 'AsciiBuilder'. printMIMEParams ∷ MIMEParams → AsciiBuilder {-# INLINEABLE printMIMEParams #-} +#if MIN_VERSION_containers(0, 4, 1) +printMIMEParams (MIMEParams m) = M.foldlWithKey' f (∅) m +#else printMIMEParams (MIMEParams m) = M.foldlWithKey f (∅) m - -- THINKME: Use foldlWithKey' for newer Data.Map +#endif where f ∷ AsciiBuilder → CIAscii → Text → AsciiBuilder {-# INLINE f #-}