addressbook/src/Data/Email.hs

14 lines
337 B
Haskell
Raw Normal View History

2020-12-10 22:22:46 +02:00
module Data.Email where
import Data.Email.Header
import Conduit
import qualified Data.Conduit.Combinators as C
import qualified Data.Conduit.Text as CT
import Data.ByteString
(ByteString)
parseEmail :: (MonadThrow m, Monad m) => ConduitM ByteString Header m ()
parseEmail = CT.decode CT.utf8 .| CT.lines .| C.concatMap decode