diff options
author | joe <joe@jerkface.net> | 2014-04-28 18:07:57 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2014-04-28 18:07:57 -0400 |
commit | de9f80091979d14fad74ad1be0e6276313eb5d3c (patch) | |
tree | 9b25835507d75ac04e885ff2f1a713e2fd370afe /KeyRing.hs | |
parent | daff3fe8911cc486c8001db6353a936816db7830 (diff) |
Changed PatternGuard usage to ViewPattern usage
Diffstat (limited to 'KeyRing.hs')
-rw-r--r-- | KeyRing.hs | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -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 #-} | ||
7 | module KeyRing | 8 | module KeyRing |
8 | ( runKeyRing | 9 | ( runKeyRing |
9 | , StreamInfo(..) | 10 | , StreamInfo(..) |
@@ -186,8 +187,8 @@ data StreamInfo = StreamInfo | |||
186 | 187 | ||
187 | 188 | ||
188 | isMutable :: StreamInfo -> Bool | 189 | isMutable :: StreamInfo -> Bool |
189 | isMutable stream | KF_None <- fill stream = False | 190 | isMutable (fill -> KF_None) = False |
190 | isMutable _ = True | 191 | isMutable _ = True |
191 | 192 | ||
192 | isring :: FileType -> Bool | 193 | isring :: FileType -> Bool |
193 | isring (KeyRingFile {}) = True | 194 | isring (KeyRingFile {}) = True |
@@ -900,9 +901,9 @@ writeHostsFiles | |||
900 | -> IO [(FilePath, KikiReportAction)] | 901 | -> IO [(FilePath, KikiReportAction)] |
901 | writeHostsFiles krd secring pubring (hostdbs0,hostdbs,u1,gpgnames,outgoing_names) = do | 902 | writeHostsFiles 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 | |||
1224 | writeWalletKeys krd db wk = do | 1225 | writeWalletKeys 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) |