From 8017336edbbfb4ab52ac3ab2309c286842e8f6a2 Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Wed, 28 Mar 2018 22:48:44 -0400 Subject: Clean up hlint warnings --- Codec/Encryption/OpenPGP/ASCIIArmor/Decode.hs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'Codec/Encryption/OpenPGP/ASCIIArmor/Decode.hs') diff --git a/Codec/Encryption/OpenPGP/ASCIIArmor/Decode.hs b/Codec/Encryption/OpenPGP/ASCIIArmor/Decode.hs index b62ff6a..5d28e46 100644 --- a/Codec/Encryption/OpenPGP/ASCIIArmor/Decode.hs +++ b/Codec/Encryption/OpenPGP/ASCIIArmor/Decode.hs @@ -25,6 +25,7 @@ import qualified Data.ByteString.Char8 as BC8 import qualified Data.ByteString.Base64 as Base64 import Data.Digest.CRC24 (crc24) import Data.Binary.Get (Get, runGetOrFail, getWord8) +import Data.Functor (($>)) import Data.String (IsString, fromString) import Data.Word (Word32) @@ -75,10 +76,10 @@ beginLine = do _ <- lineEnding "line ending" return atype where - message = string "MESSAGE" *> return ArmorMessage - pubkey = string "PUBLIC KEY BLOCK" *> return ArmorPublicKeyBlock - privkey = string "PRIVATE KEY BLOCK" *> return ArmorPrivateKeyBlock - signature = string "SIGNATURE" *> return ArmorSignature + message = string "MESSAGE" $> ArmorMessage + pubkey = string "PUBLIC KEY BLOCK" $> ArmorPublicKeyBlock + privkey = string "PRIVATE KEY BLOCK" $> ArmorPrivateKeyBlock + signature = string "SIGNATURE" $> ArmorSignature parts = string "MESSAGE, PART " *> (partsdef <|> partsindef) partsdef = do firstnum <- num @@ -113,12 +114,12 @@ endLine atype = do lineEnding aType :: ArmorType -> B.ByteString -aType (ArmorMessage) = BC8.pack "MESSAGE" -aType (ArmorPublicKeyBlock) = BC8.pack "PUBLIC KEY BLOCK" -aType (ArmorPrivateKeyBlock) = BC8.pack "PRIVATE KEY BLOCK" +aType ArmorMessage = BC8.pack "MESSAGE" +aType ArmorPublicKeyBlock = BC8.pack "PUBLIC KEY BLOCK" +aType ArmorPrivateKeyBlock = BC8.pack "PRIVATE KEY BLOCK" aType (ArmorSplitMessage x y) = BC8.pack "MESSAGE, PART " `B.append` l2s x `B.append` BC8.singleton '/' `B.append` l2s y aType (ArmorSplitMessageIndefinite x) = BC8.pack "MESSAGE, PART " `B.append` l2s x -aType (ArmorSignature) = BC8.pack "SIGNATURE" +aType ArmorSignature = BC8.pack "SIGNATURE" l2s :: BL.ByteString -> B.ByteString l2s = B.concat . BL.toChunks -- cgit v1.2.3