summaryrefslogtreecommitdiff
path: root/Types
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
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')
-rw-r--r--Types/StandardGroups.hs1
-rw-r--r--Types/TrustLevel.hs4
2 files changed, 5 insertions, 0 deletions
diff --git a/Types/StandardGroups.hs b/Types/StandardGroups.hs
index 66c1dd5ef..a60445a65 100644
--- a/Types/StandardGroups.hs
+++ b/Types/StandardGroups.hs
@@ -9,6 +9,7 @@ module Types.StandardGroups where
import Types.Remote (RemoteConfig)
import Types.Group
+import Data.Default
import qualified Data.Map as M
import Data.Maybe
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