packages feed

papa-0.4.0: src/Papa/Base/Data/Monoid.hs

{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -Wall #-}

module Papa.Base.Data.Monoid (
  module P,
  mconcat,
) where

import Data.Monoid as P (
  Monoid (mappend, mempty),
 )

import Data.Foldable (Foldable, fold)

{-# INLINE mconcat #-}
-- | Fold a list using the monoid.
--
-- >>> mconcat [[1,2], [3,4], [5,6]]
-- [1,2,3,4,5,6]
-- >>> mconcat ["hello", " ", "world"]
-- "hello world"
mconcat ::
  (Monoid a, Foldable f) =>
  f a ->
  a
mconcat =
  fold