diff options
author | Austin Seipp <austin@well-typed.com> | 2014-02-28 14:53:40 -0600 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2014-02-28 15:42:15 -0600 |
commit | 1d1ff77aaa09efaddc8cfe0dcf92d6763297cf11 (patch) | |
tree | 7ad688824f0cc5d9c69d823b849a7173a8ea480d /libraries/base/Data/Proxy.hs | |
parent | e467d93699cc1711a64d3402af3c7ab581a406f1 (diff) | |
download | haskell-1d1ff77aaa09efaddc8cfe0dcf92d6763297cf11.tar.gz |
Add some instances for Monoid/Applicative (#8797)
As noted in the ticket, there's no particular reason why there aren't
Generic, Typeable, and Data instances for the types in the
Monoid/Applicative modules.
Furthermore, Product and Sum should also have Num instances as well as
Edward noted.
Aside from that, this patch also changes the dependency chain slightly -
it moves the Monoid Proxy instance into Data.Monoid and out of
Data.Proxy.
Why? Cycles (of course). Monoid depends on Typeable. Typeable uses
Proxy. Proxy uses Monoid. Boom. Luckily, Proxy only depends on Monoid
outside of the GHC namespace, so the fix is easy and clean.
Signed-off-by: Austin Seipp <austin@well-typed.com>
Diffstat (limited to 'libraries/base/Data/Proxy.hs')
-rw-r--r-- | libraries/base/Data/Proxy.hs | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/libraries/base/Data/Proxy.hs b/libraries/base/Data/Proxy.hs index 4c2c5df8f8..ab89066cfa 100644 --- a/libraries/base/Data/Proxy.hs +++ b/libraries/base/Data/Proxy.hs @@ -21,8 +21,6 @@ module Data.Proxy , KProxy(..) ) where -import Data.Monoid - import GHC.Base import GHC.Show import GHC.Read @@ -75,14 +73,6 @@ instance Functor Proxy where fmap _ _ = Proxy {-# INLINE fmap #-} -instance Monoid (Proxy s) where - mempty = Proxy - {-# INLINE mempty #-} - mappend _ _ = Proxy - {-# INLINE mappend #-} - mconcat _ = Proxy - {-# INLINE mconcat #-} - instance Monad Proxy where return _ = Proxy {-# INLINE return #-} |