aboutsummaryrefslogtreecommitdiff
path: root/Types/TrustLevel.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-10-14 14:10:22 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-10-14 14:15:07 -0400
commit9f5b8638a990f8d163afaf62e15331515fdcb21f (patch)
tree51584af5c9bfe07e12703bf5dabc45bf776b57e3 /Types/TrustLevel.hs
parent9433c62da3d0c7b45ba528f01e000630f999cb27 (diff)
vicfg: Deleting configurations now resets to the default, where before it has no effect.
Added a Default instance for TrustLevel, and was able to use that to clear up several other parts of the code too. This commit was sponsored by Stephan Schulz
Diffstat (limited to 'Types/TrustLevel.hs')
-rw-r--r--Types/TrustLevel.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/Types/TrustLevel.hs b/Types/TrustLevel.hs
index a72dbb8c6..4af71294a 100644
--- a/Types/TrustLevel.hs
+++ b/Types/TrustLevel.hs
@@ -14,6 +14,7 @@ module Types.TrustLevel (
) where
import qualified Data.Map as M
+import Data.Default
import Types.UUID
@@ -22,6 +23,9 @@ import Types.UUID
data TrustLevel = Trusted | SemiTrusted | UnTrusted | DeadTrusted
deriving (Eq, Enum, Ord, Bounded)
+instance Default TrustLevel where
+ def = SemiTrusted
+
type TrustMap = M.Map UUID TrustLevel
readTrustLevel :: String -> Maybe TrustLevel