Skip to content
Snippets Groups Projects
Commit cc38b30d authored by Ryan Scott's avatar Ryan Scott
Browse files

endo: Define missing Eq/Ord/Read/Show instances

These are required to satisfy the new quantified superclasses for
`{Eq,Ord,Read,Show}1`.
parent b078702b
No related branches found
No related tags found
No related merge requests found
...@@ -19,10 +19,19 @@ index 02daa2d..21daf57 100644 ...@@ -19,10 +19,19 @@ index 02daa2d..21daf57 100644
if impl(GHC >=7.8) if impl(GHC >=7.8)
cpp-options: cpp-options:
diff --git a/src/Data/Monoid/Endo/AnEndo.hs b/src/Data/Monoid/Endo/AnEndo.hs diff --git a/src/Data/Monoid/Endo/AnEndo.hs b/src/Data/Monoid/Endo/AnEndo.hs
index b611f98..0134879 100644 index b611f98..0cab2da 100644
--- a/src/Data/Monoid/Endo/AnEndo.hs --- a/src/Data/Monoid/Endo/AnEndo.hs
+++ b/src/Data/Monoid/Endo/AnEndo.hs +++ b/src/Data/Monoid/Endo/AnEndo.hs
@@ -82,7 +82,9 @@ import Data.Monoid @@ -50,6 +50,8 @@ module Data.Monoid.Endo.AnEndo
)
where
+import Prelude (Eq, Ord)
+
import Control.Applicative (Applicative)
import Control.Monad (Monad)
import Data.Foldable (Foldable(foldMap))
@@ -82,7 +84,9 @@ import Data.Monoid
, (<>) , (<>)
) )
#ifdef HAVE_SEMIGROUPS #ifdef HAVE_SEMIGROUPS
...@@ -32,7 +41,7 @@ index b611f98..0134879 100644 ...@@ -32,7 +41,7 @@ index b611f98..0134879 100644
#endif #endif
import Data.Traversable (Traversable) import Data.Traversable (Traversable)
import GHC.Generics (Generic, Generic1) import GHC.Generics (Generic, Generic1)
@@ -201,6 +203,7 @@ instance AnEndo (Proxy a) where @@ -201,6 +205,7 @@ instance AnEndo (Proxy a) where
#endif #endif
#ifdef HAVE_SEMIGROUPS #ifdef HAVE_SEMIGROUPS
...@@ -40,7 +49,7 @@ index b611f98..0134879 100644 ...@@ -40,7 +49,7 @@ index b611f98..0134879 100644
-- | Has same semantics as 'Maybe' and it is actually defined in terms of -- | Has same semantics as 'Maybe' and it is actually defined in terms of
-- 'AnEndo' instance for 'Maybe'. -- 'AnEndo' instance for 'Maybe'.
instance AnEndo a => AnEndo (Option a) where instance AnEndo a => AnEndo (Option a) where
@@ -208,6 +211,7 @@ instance AnEndo a => AnEndo (Option a) where @@ -208,6 +213,7 @@ instance AnEndo a => AnEndo (Option a) where
anEndo (Option maybe) = anEndo maybe anEndo (Option maybe) = anEndo maybe
aDualEndo (Option maybe) = aDualEndo maybe aDualEndo (Option maybe) = aDualEndo maybe
...@@ -48,3 +57,46 @@ index b611f98..0134879 100644 ...@@ -48,3 +57,46 @@ index b611f98..0134879 100644
#endif #endif
-- {{{ Foldable Instances ----------------------------------------------------- -- {{{ Foldable Instances -----------------------------------------------------
@@ -218,11 +224,13 @@ instance AnEndo a => AnEndo (Option a) where
newtype WrappedFoldable f a = WrapFoldable {getFoldable :: f a}
deriving
( Applicative
+ , Eq
, Foldable
, Functor
, Generic
, Generic1
, Monad
+ , Ord
, Read
, Show
, Traversable
diff --git a/src/Data/Monoid/Endo/Apply.hs b/src/Data/Monoid/Endo/Apply.hs
index 8fb26e0..40b71d7 100644
--- a/src/Data/Monoid/Endo/Apply.hs
+++ b/src/Data/Monoid/Endo/Apply.hs
@@ -69,7 +69,7 @@ module Data.Monoid.Endo.Apply
)
where
-import Prelude (seq)
+import Prelude (Eq, Ord, Read, Show, seq)
import Control.Applicative (Applicative(pure))
import Control.Monad
@@ -126,11 +126,15 @@ import Data.Monoid.Endo.FromEndo (FromEndo(..))
newtype ApplyEndo t f a = ApplyEndo {applyEndo :: f a}
deriving
( Applicative
+ , Eq
, Foldable
, Functor
, Generic
, Generic1
+ , Ord
, Monad
+ , Read
+ , Show
, Traversable
#ifdef HAVE_KIND_POLYMORPHIC_TYPEABLE
, Data
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment