Skip to content

Commit d2a1df7

Browse files
committed
Fixing more instance constraints
1 parent f60f1a0 commit d2a1df7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Data/Monoid/DecidablyEmpty.hs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ instance DecidablyEmpty All
4747
instance DecidablyEmpty [a] where
4848
isEmpty = null
4949
instance
50-
#if MIN_VERSION_base(4,10,0)
50+
#if MIN_VERSION_base(4,11,0)
5151
Semigroup a
5252
#else
5353
Monoid a
@@ -57,8 +57,10 @@ instance
5757
deriving instance (Num a, DecidablyEmpty a) => DecidablyEmpty (Product a)
5858
deriving instance (DecidablyEmpty a, Num a) => DecidablyEmpty (Sum a)
5959
deriving instance DecidablyEmpty a => DecidablyEmpty (Dual a)
60-
deriving instance Semigroup a => DecidablyEmpty (First a)
61-
deriving instance Semigroup a => DecidablyEmpty (Last a)
60+
instance DecidablyEmpty (First a) where
61+
isEmpty (First a) = isNothing a
62+
instance DecidablyEmpty (Last a) where
63+
isEmpty (Last a) = isNothing a
6264
deriving instance DecidablyEmpty a => DecidablyEmpty (Identity a)
6365
deriving instance Semigroup a => DecidablyEmpty (Option a)
6466
deriving instance DecidablyEmpty m => DecidablyEmpty (WrappedMonoid m)

0 commit comments

Comments
 (0)