Skip to content

Commit f60f1a0

Browse files
committed
CPP Maybe's superclasses
1 parent 44c2cca commit f60f1a0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Data/Monoid/DecidablyEmpty.hs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,13 @@ instance DecidablyEmpty All
4646
-- instance DecidablyEmpty Event
4747
instance DecidablyEmpty [a] where
4848
isEmpty = null
49-
instance Semigroup a => DecidablyEmpty (Maybe a) where
49+
instance
50+
#if MIN_VERSION_base(4,10,0)
51+
Semigroup a
52+
#else
53+
Monoid a
54+
#endif
55+
=> DecidablyEmpty (Maybe a) where
5056
isEmpty = isNothing
5157
deriving instance (Num a, DecidablyEmpty a) => DecidablyEmpty (Product a)
5258
deriving instance (DecidablyEmpty a, Num a) => DecidablyEmpty (Sum a)

0 commit comments

Comments
 (0)