From 0d8f718f4c7babafab9ab11e78b58823b7682522 Mon Sep 17 00:00:00 2001 From: PHO Date: Mon, 14 Nov 2011 11:16:39 +0900 Subject: [PATCH] Use Data.Map.foldlWithKey' when possible --- Network/HTTP/Lucu/MIMEParams.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 #-} -- 2.40.0