module Data.Monoid.Utils (
mintercalate
, mspace
, smappend
, smconcat
, (<+>)
) where
import Data.List
import Data.Monoid
import Data.String
import Prelude
mintercalate :: Monoid m => m -> [m] -> m
mintercalate m = mconcat . intersperse m
mspace :: (IsString m, Monoid m) => m
mspace = fromString " "
smappend :: (IsString m, Monoid m) => m -> m -> m
smappend a b = mconcat [a, mspace, b]
smconcat :: (IsString m, Monoid m) => [m] -> m
smconcat = mintercalate mspace
(<+>) :: (IsString m, Monoid m) => m -> m -> m
(<+>) = smappend
infixr 6 <+>