Skip to content

Commit f39c676

Browse files
committed
Add default method for DecidablyEmpty.isEmpty
1 parent 510e5e2 commit f39c676

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Data/Monoid/DecidablyEmpty.hs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
{-# LANGUAGE DefaultSignatures #-}
2+
13
-- TODO upstream somwhere else?
24
module Data.Monoid.DecidablyEmpty where
35

46
class Monoid a => DecidablyEmpty a where
57
isEmpty :: a -> Bool
8+
default isEmpty :: Eq a => a -> Bool
9+
isEmpty = (==) mempty

0 commit comments

Comments
 (0)