summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2014-04-28 18:07:57 -0400
committerjoe <joe@jerkface.net>2014-04-28 18:07:57 -0400
commitde9f80091979d14fad74ad1be0e6276313eb5d3c (patch)
tree9b25835507d75ac04e885ff2f1a713e2fd370afe
parentdaff3fe8911cc486c8001db6353a936816db7830 (diff)
Changed PatternGuard usage to ViewPattern usage
-rw-r--r--KeyRing.hs17
1 files changed, 9 insertions, 8 deletions
diff --git a/KeyRing.hs b/KeyRing.hs
index 4e6c512..62e46a8 100644
--- a/KeyRing.hs
+++ b/KeyRing.hs
@@ -4,6 +4,7 @@
4{-# LANGUAGE OverloadedStrings #-} 4{-# LANGUAGE OverloadedStrings #-}
5{-# LANGUAGE DeriveFunctor #-} 5{-# LANGUAGE DeriveFunctor #-}
6{-# LANGUAGE DoAndIfThenElse #-} 6{-# LANGUAGE DoAndIfThenElse #-}
7{-# LANGUAGE NoPatternGuards #-}
7module KeyRing 8module KeyRing
8 ( runKeyRing 9 ( runKeyRing
9 , StreamInfo(..) 10 , StreamInfo(..)
@@ -186,8 +187,8 @@ data StreamInfo = StreamInfo
186 187
187 188
188isMutable :: StreamInfo -> Bool 189isMutable :: StreamInfo -> Bool
189isMutable stream | KF_None <- fill stream = False 190isMutable (fill -> KF_None) = False
190isMutable _ = True 191isMutable _ = True
191 192
192isring :: FileType -> Bool 193isring :: FileType -> Bool
193isring (KeyRingFile {}) = True 194isring (KeyRingFile {}) = True
@@ -900,9 +901,9 @@ writeHostsFiles
900 -> IO [(FilePath, KikiReportAction)] 901 -> IO [(FilePath, KikiReportAction)]
901writeHostsFiles krd secring pubring (hostdbs0,hostdbs,u1,gpgnames,outgoing_names) = do 902writeHostsFiles krd secring pubring (hostdbs0,hostdbs,u1,gpgnames,outgoing_names) = do
902 let hns = files isMutableHosts 903 let hns = files isMutableHosts
903 isMutableHosts stream | KF_None <- fill stream = False 904 isMutableHosts (fill -> KF_None) = False
904 isMutableHosts stream | Hosts <- typ stream = True 905 isMutableHosts (typ -> Hosts) = True
905 isMutableHosts _ = False 906 isMutableHosts _ = False
906 files istyp = do 907 files istyp = do
907 (f,stream) <- Map.toList (kFiles krd) 908 (f,stream) <- Map.toList (kFiles krd)
908 guard (istyp stream) 909 guard (istyp stream)
@@ -1224,9 +1225,9 @@ writeWalletKeys :: KeyRingOperation -> KeyDB -> Maybe Packet -> IO (KikiConditio
1224writeWalletKeys krd db wk = do 1225writeWalletKeys krd db wk = do
1225 let cs = db `coinKeysOwnedBy` wk 1226 let cs = db `coinKeysOwnedBy` wk
1226 -- export wallet keys 1227 -- export wallet keys
1227 isMutableWallet stream | KF_None <- fill stream = False 1228 isMutableWallet (fill -> KF_None) = False
1228 isMutableWallet stream | WalletFile {} <- typ stream = True 1229 isMutableWallet (typ -> WalletFile {}) = True
1229 isMutableWallet _ = False 1230 isMutableWallet _ = False
1230 files pred = do 1231 files pred = do
1231 (f,stream) <- Map.toList (kFiles krd) 1232 (f,stream) <- Map.toList (kFiles krd)
1232 guard (pred stream) 1233 guard (pred stream)