From: PHO Date: Mon, 14 Nov 2011 02:16:39 +0000 (+0900) Subject: Use Data.Map.foldlWithKey' when possible X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=0d8f718f4c7babafab9ab11e78b58823b7682522;p=Lucu.git Use Data.Map.foldlWithKey' when possible --- diff --git a/Network/HTTP/Lucu/MIMEParams.hs b/Network/HTTP/Lucu/MIMEParams.hs index bfde1c9..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 @@ -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 #-}