Permalink
Browse files

use 'mconcat' instead of 'fold mappend mempty'

  • Loading branch information...
1 parent face054 commit e5fbe6d21e0a79fe12b0c01a0e35cd91d208713f @skogsbaer committed May 21, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/Text/XML/Generator.hs
@@ -54,6 +54,7 @@ import Control.Monad.Reader (Reader(..), ask, asks, runReader)
import qualified Data.Map as Map
import qualified Data.ByteString.Lazy as BSL
import Data.Monoid hiding (mconcat)
+import qualified Data.Monoid as M
import Blaze.ByteString.Builder
import qualified Blaze.ByteString.Builder as Blaze
@@ -277,7 +278,7 @@ xattrQRaw' ns' key valueBuilder = Xml $
-- | Merges a list of attributes into a single piece of XML at the attribute level.
xattrs :: [Xml Attr] -> Xml Attr
-xattrs = foldr mappend noAttrs
+xattrs = M.mconcat
-- | The empty attribute list.
noAttrs :: Xml Attr
@@ -382,7 +383,7 @@ xelemQ ns' name children = Xml $
-- | Merges a list of elements into a single piece of XML at the element level.
xelems :: [Xml Elem] -> Xml Elem
-xelems = foldr mappend noElems
+xelems = M.mconcat
-- | No elements at all.
noElems :: Xml Elem

0 comments on commit e5fbe6d

Please sign in to comment.