Copyright | (c) Gershom Bazerman, 2009; ported to Text by Alexander Jerneck, 2012 |
---|---|
License | BSD 3 Clause |
Maintainer | gershomb@gmail.com |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell98 |
Reads and writes mboxrd files as per http://www.qmail.org/man/man5/mbox.html.
This module uses Lazy Text pervasively, and should be able to operate as a streaming parser. That is to say, given a lazy stream of Text, and a streaming processing function, you should be able to analyze large mbox files in constant space.
- type MBox = [Message]
- data Message = Message {}
- type Header = (Text, Text)
- parseMBox :: Text -> MBox
- parseForward :: Message -> Message
- parseDateHeader :: Text -> Maybe UTCTime
- showMessage :: Message -> Text
- showMBox :: MBox -> Text
- getHeader :: (Header -> Bool) -> Message -> Text
- isID :: Header -> Bool
- isDate :: Header -> Bool
Documentation
parseForward :: Message -> Message Source
Attempts to retrieve the contents of a forwarded message from an enclosing message.
parseDateHeader :: Text -> Maybe UTCTime Source
Reads a date header as a UTCTime
showMessage :: Message -> Text Source
Renders an individual message into Text.