summaryrefslogtreecommitdiff
path: root/src/Propellor/Types/Empty.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Propellor/Types/Empty.hs')
-rw-r--r--src/Propellor/Types/Empty.hs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Propellor/Types/Empty.hs b/src/Propellor/Types/Empty.hs
new file mode 100644
index 00000000..dcd2f4a0
--- /dev/null
+++ b/src/Propellor/Types/Empty.hs
@@ -0,0 +1,16 @@
+module Propellor.Types.Empty where
+
+import qualified Data.Map as M
+import qualified Data.Set as S
+
+class Empty t where
+ isEmpty :: t -> Bool
+
+instance Empty [a] where
+ isEmpty = null
+
+instance Empty (M.Map k v) where
+ isEmpty = M.null
+
+instance Empty (S.Set v) where
+ isEmpty = S.null