X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=Network%2FHTTP%2FLucu%2FMIMEParams.hs;h=9e5b938b384f4b3e24157a8ead92e24fb94041a1;hb=b87f64c979c79592e6824ee531478eacdaa384bb;hp=bfde1c932e3156e4db53456994c15943f3b8e9e4;hpb=48bc90d66a45c0b9b6f52272b46cf2949ed802e3;p=Lucu.git diff --git a/Network/HTTP/Lucu/MIMEParams.hs b/Network/HTTP/Lucu/MIMEParams.hs index bfde1c9..9e5b938 100644 --- a/Network/HTTP/Lucu/MIMEParams.hs +++ b/Network/HTTP/Lucu/MIMEParams.hs @@ -1,5 +1,6 @@ {-# LANGUAGE - DeriveDataTypeable + CPP + , DeriveDataTypeable , DoAndIfThenElse , GeneralizedNewtypeDeriving , OverloadedStrings @@ -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 #-} @@ -180,8 +184,7 @@ initialEncodedValue -- NOTE: I'm not sure this is the right thing, but RFC -- 2231 doesn't tell us what we should do when the -- charset is omitted. - return ("US-ASCII", payload) - -- FIXME: Rethink about this behaviour. + fail "charset is missing" else return (charset, payload) where