X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Data%2FMonoid.hs;h=aaefd42169c7bdc85ba028ddd1d1df4aeda4089b;hb=HEAD;hp=a0e3b20eff6b979a84b73f4cd78d1333f4f04f52;hpb=56c20c2ebf7c840e9bc7d81e6497c6d89cb9e88f;p=ghc-base.git diff --git a/Data/Monoid.hs b/Data/Monoid.hs index a0e3b20..aaefd42 100644 --- a/Data/Monoid.hs +++ b/Data/Monoid.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE CPP, NoImplicitPrelude #-} + ----------------------------------------------------------------------------- -- | -- Module : Data.Monoid @@ -30,7 +32,17 @@ module Data.Monoid ( Last(..) ) where +-- Push down the module in the dependency hierarchy. +#if defined(__GLASGOW_HASKELL__) +import GHC.Base hiding (Any) +import GHC.Enum +import GHC.Num +import GHC.Read +import GHC.Show +import Data.Maybe +#else import Prelude +#endif {- -- just for testing @@ -40,7 +52,17 @@ import Test.QuickCheck -- --------------------------------------------------------------------------- -- | The class of monoids (types with an associative binary operation that --- has an identity). The method names refer to the monoid of lists, +-- has an identity). Instances should satisfy the following laws: +-- +-- * @mappend mempty x = x@ +-- +-- * @mappend x mempty = x@ +-- +-- * @mappend x (mappend y z) = mappend (mappend x y) z@ +-- +-- * @mconcat = 'foldr' mappend mempty@ +-- +-- The method names refer to the monoid of lists under concatenation, -- but there are many other instances. -- -- Minimal complete definition: 'mempty' and 'mappend'.