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
This commit is contained in:
Joey Hess 2014-10-14 14:10:22 -04:00
parent 5fcb75d371
commit db9121ecee
7 changed files with 41 additions and 5 deletions

View file

@ -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