summaryrefslogtreecommitdiff
path: root/Crypto.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-08-25 00:28:55 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-08-25 01:27:19 -0400
commit678726c10c13481c082743808a5188d28567e2b3 (patch)
treea5052eb5b20444e10d3f5d467281ef4c0f5975d1 /Crypto.hs
parent20259c2955e408a72e0960207fc8be4cbeec2e21 (diff)
code simplification thanks to applicative functors
Diffstat (limited to 'Crypto.hs')
-rw-r--r--Crypto.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Crypto.hs b/Crypto.hs
index ed29747aa..d789b4455 100644
--- a/Crypto.hs
+++ b/Crypto.hs
@@ -38,6 +38,7 @@ import System.IO
import System.Posix.IO
import System.Posix.Types
import System.Posix.Process
+import Control.Applicative
import Control.Concurrent
import Control.Exception (finally)
import System.Exit
@@ -136,7 +137,7 @@ encryptCipher (Cipher c) (KeyIds ks) = do
{- Decrypting an EncryptedCipher is expensive; the Cipher should be cached. -}
decryptCipher :: RemoteConfig -> EncryptedCipher -> IO Cipher
decryptCipher _ (EncryptedCipher encipher _) =
- return . Cipher =<< gpgPipeStrict decrypt encipher
+ Cipher <$> gpgPipeStrict decrypt encipher
where
decrypt = [ Param "--decrypt" ]