diff options
author | Stephen Paul Weber <singpolyma@singpolyma.net> | 2012-04-25 19:23:50 -0500 |
---|---|---|
committer | Stephen Paul Weber <singpolyma@singpolyma.net> | 2012-04-25 19:23:50 -0500 |
commit | 0a474e49af677d1b9dd9570e3f54b5f52f8ab901 (patch) | |
tree | 8eede2bcaf1098e5dd1ba29cbd58b5be21483ac9 /Data | |
parent | 91e6b9448b36f4775026597e0df1f7b28b5db906 (diff) |
Use mapM_ for Message put
Diffstat (limited to 'Data')
-rw-r--r-- | Data/OpenPGP.hs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Data/OpenPGP.hs b/Data/OpenPGP.hs index 818c125..06aa930 100644 --- a/Data/OpenPGP.hs +++ b/Data/OpenPGP.hs | |||
@@ -554,10 +554,7 @@ instance Binary CompressionAlgorithm where | |||
554 | -- A message is encoded as a list that takes the entire file | 554 | -- A message is encoded as a list that takes the entire file |
555 | newtype Message = Message [Packet] deriving (Show, Read, Eq) | 555 | newtype Message = Message [Packet] deriving (Show, Read, Eq) |
556 | instance Binary Message where | 556 | instance Binary Message where |
557 | put (Message []) = return () | 557 | put (Message xs) = mapM_ put xs |
558 | put (Message (x:xs)) = do | ||
559 | put x | ||
560 | put (Message xs) | ||
561 | get = fmap Message listUntilEnd | 558 | get = fmap Message listUntilEnd |
562 | 559 | ||
563 | -- | Extract all signature and data packets from a 'Message' | 560 | -- | Extract all signature and data packets from a 'Message' |