on develop help sign in
Add DecidablyEmpty instance for Proxy
commit82c1cd150666c0ad42aa3a935f469b7c571e73d2 authorJohn Ericson <John.Ericson@Obsidian.Systems> dateWed 22 Jan 2020, 16:47 (7 years ago) parentc97c126
1 file changed+5
src/Data/Monoid/DecidablyEmpty.hs+5
src/Data/Monoid/DecidablyEmpty.hs+5
@@ -3,7 +3,12 @@
33-- TODO upstream somwhere else?
44module Data.Monoid.DecidablyEmpty where
55
6+import Data.Proxy
7+
68class Monoid a => DecidablyEmpty a where
79 isEmpty :: a -> Bool
810 default isEmpty :: Eq a => a -> Bool
911 isEmpty = (==) mempty
12+
13+instance DecidablyEmpty (Proxy a) where
14+ isEmpty ~Proxy = True