From de9f80091979d14fad74ad1be0e6276313eb5d3c Mon Sep 17 00:00:00 2001 From: joe Date: Mon, 28 Apr 2014 18:07:57 -0400 Subject: Changed PatternGuard usage to ViewPattern usage --- KeyRing.hs | 17 +++++++++-------- 1 file 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 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DoAndIfThenElse #-} +{-# LANGUAGE NoPatternGuards #-} module KeyRing ( runKeyRing , StreamInfo(..) @@ -186,8 +187,8 @@ data StreamInfo = StreamInfo isMutable :: StreamInfo -> Bool -isMutable stream | KF_None <- fill stream = False -isMutable _ = True +isMutable (fill -> KF_None) = False +isMutable _ = True isring :: FileType -> Bool isring (KeyRingFile {}) = True @@ -900,9 +901,9 @@ writeHostsFiles -> IO [(FilePath, KikiReportAction)] writeHostsFiles krd secring pubring (hostdbs0,hostdbs,u1,gpgnames,outgoing_names) = do let hns = files isMutableHosts - isMutableHosts stream | KF_None <- fill stream = False - isMutableHosts stream | Hosts <- typ stream = True - isMutableHosts _ = False + isMutableHosts (fill -> KF_None) = False + isMutableHosts (typ -> Hosts) = True + isMutableHosts _ = False files istyp = do (f,stream) <- Map.toList (kFiles krd) guard (istyp stream) @@ -1224,9 +1225,9 @@ writeWalletKeys :: KeyRingOperation -> KeyDB -> Maybe Packet -> IO (KikiConditio writeWalletKeys krd db wk = do let cs = db `coinKeysOwnedBy` wk -- export wallet keys - isMutableWallet stream | KF_None <- fill stream = False - isMutableWallet stream | WalletFile {} <- typ stream = True - isMutableWallet _ = False + isMutableWallet (fill -> KF_None) = False + isMutableWallet (typ -> WalletFile {}) = True + isMutableWallet _ = False files pred = do (f,stream) <- Map.toList (kFiles krd) guard (pred stream) -- cgit v1.2.3