From 00dad0cfc02fdd78abe425aa29b41855a22dea1a Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Thu, 26 Apr 2012 20:40:26 -0400 Subject: Make hlint happy. --- Codec/Encryption/OpenPGP/ASCIIArmor/Multipart.hs | 2 +- Data/Digest/CRC24.hs | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Codec/Encryption/OpenPGP/ASCIIArmor/Multipart.hs b/Codec/Encryption/OpenPGP/ASCIIArmor/Multipart.hs index 313c3bc..e3f6c34 100644 --- a/Codec/Encryption/OpenPGP/ASCIIArmor/Multipart.hs +++ b/Codec/Encryption/OpenPGP/ASCIIArmor/Multipart.hs @@ -17,7 +17,7 @@ multipartMerge as = go as (Armor ArmorMessage [] BL.empty) where go :: [Armor] -> Armor -> Armor go [] state = state - go ((Armor at hs bs):as) state = go as (go' at hs bs state) + go (Armor at hs bs:as) state = go as (go' at hs bs state) go' :: ArmorType -> [(String,String)] -> ByteString -> Armor -> Armor go' (ArmorSplitMessage _ _) hs bs (Armor _ ohs obs) = Armor ArmorMessage (ohs ++ hs) (obs `BL.append` bs) go' (ArmorSplitMessageIndefinite _) hs bs (Armor _ ohs obs) = Armor ArmorMessage (ohs ++ hs) (obs `BL.append` bs) diff --git a/Data/Digest/CRC24.hs b/Data/Digest/CRC24.hs index 4586177..87b3bc9 100644 --- a/Data/Digest/CRC24.hs +++ b/Data/Digest/CRC24.hs @@ -14,17 +14,17 @@ import qualified Data.ByteString as B import qualified Data.ByteString.Lazy as BL import Data.Word (Word8, Word32) -crc24_init :: Word32 -crc24_init = 0xB704CE +crc24Init :: Word32 +crc24Init = 0xB704CE -crc24_poly :: Word32 -crc24_poly = 0x1864CFB +crc24Poly :: Word32 +crc24Poly = 0x1864CFB -crc24_update :: Word32 -> Word8 -> Word32 -crc24_update c b = (last . take 9 $ iterate (\x -> if (shiftL x 1) .&. 0x1000000 == 0x1000000 then shiftL x 1 `xor` crc24_poly else shiftL x 1) (c `xor` shiftL (fromIntegral b) 16)) .&. 0xFFFFFF +crc24Update :: Word32 -> Word8 -> Word32 +crc24Update c b = (last . take 9 $ iterate (\x -> if shiftL x 1 .&. 0x1000000 == 0x1000000 then shiftL x 1 `xor` crc24Poly else shiftL x 1) (c `xor` shiftL (fromIntegral b) 16)) .&. 0xFFFFFF crc24 :: B.ByteString -> Word32 crc24 bs = crc24Lazy . BL.fromChunks $ [bs] crc24Lazy :: ByteString -> Word32 -crc24Lazy bs = BL.foldl crc24_update crc24_init bs +crc24Lazy = BL.foldl crc24Update crc24Init -- cgit v1.2.3