on develop help sign in
Add DecidablyEmpty instance for Proxy
82c1cd1John Ericson
src/Data/Monoid/DecidablyEmpty.hs+5
@@ -3,7 +3,12 @@
3-- TODO upstream somwhere else?
3-- TODO upstream somwhere else?
4module Data.Monoid.DecidablyEmpty where
4module Data.Monoid.DecidablyEmpty where
5
5
6+import Data.Proxy
7+
6class Monoid a => DecidablyEmpty a where
8class Monoid a => DecidablyEmpty a where
7 isEmpty :: a -> Bool
9 isEmpty :: a -> Bool
8 default isEmpty :: Eq a => a -> Bool
10 default isEmpty :: Eq a => a -> Bool
9 isEmpty = (==) mempty
11 isEmpty = (==) mempty
12+
13+instance DecidablyEmpty (Proxy a) where
14+ isEmpty ~Proxy = True