From f25d0d8d82dff0be2d68476148479004b2888bd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Benencia?= Date: Sun, 25 Aug 2013 17:56:39 -0300 Subject: Finished porting to state monad --- Email.hs | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) (limited to 'Email.hs') diff --git a/Email.hs b/Email.hs index 78ffff6..40d1c4c 100644 --- a/Email.hs +++ b/Email.hs @@ -1,19 +1,10 @@ --- This module is part of Lazymail, a Haskell email client. --- --- Copyright (C) 2013 Raúl Benencia --- --- This program is free software: you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation, either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program. If not, see . +{- Email accessors. + - + - Copyright 2013 Raúl Benencia + - + - Licensed under the GNU GPL version 3 or higher + - + -} module Email where import Network.Email.Mailbox(Flag(..), Flags) @@ -25,7 +16,7 @@ import Text.ParserCombinators.Parsec.Rfc2822 data Email = Email { emailPath :: String , parsedEmail :: Message } - + parseEmail :: String -> Message parseEmail msg = unwrapEmail $ parse message "" $ fixEol msg @@ -55,7 +46,7 @@ getResentBcc fs = do { ResentBcc f <- fs; f } getResentMessageID fs = do { ResentMessageID f <- fs; f } --getReceived fs = do { Received f <- fs; f } -getBody (Message _ []) = "Empty body" +getBody (Message _ []) = "Empty body" getBody (Message _ body) = body -- Make sure all lines are terminated by CRLF. @@ -72,6 +63,6 @@ fixEol [] = [] -- emailDescription = emailDescriptionWithPP defaultDescriptionPP --- emailDescriptionWithPP pp +-- emailDescriptionWithPP pp -- cgit v1.2.3