Network.Email.Mailbox

MissingH-1.1.1.0: Large utility library

Portability | portable
Stability | provisional
Maintainer | John Goerzen <jgoerzen@complete.org>

Network.Email.Mailbox

Description

General support for e-mail mailboxes

Written by John Goerzen, jgoerzen@complete.org

Synopsis

- data Flag
  - = SEEN
  - | ANSWERED
  - | FLAGGED
  - | DELETED
  - | DRAFT
  - | FORWARDED
  - | OTHERFLAG String
- type Flags = [Flag]
- type Message = String
- class (Show a, Show b, Eq b) => MailboxReader a b where
  - listIDs :: a -> IO [b]
  - listMessageFlags :: a -> IO [(b, Flags)]
  - getAll :: a -> IO [(b, Flags, Message)]
  - getMessages :: a -> [b] -> IO [(b, Flags, Message)]
- class MailboxReader a b => MailboxWriter a b where
  - appendMessages :: a -> [(Flags, Message)] -> IO [b]
  - deleteMessages :: a -> [b] -> IO ()
  - addFlags :: a -> [b] -> Flags -> IO ()
  - removeFlags :: a -> [b] -> Flags -> IO ()
  - setFlags :: a -> [b] -> Flags -> IO ()

# Documentation

data Flag

The flags which may be assigned to a message.

Constructors

SEEN |
ANSWERED |
FLAGGED |
DELETED |
DRAFT |
FORWARDED |
OTHERFLAG String |

Instances

Eq Flag |
Show Flag |

type Flags = [Flag]

Convenience shortcut

type Message = String

A Message is represented as a simple String.

class (Show a, Show b, Eq b) => MailboxReader a b where

Main class for readable mailboxes.

The mailbox object a represents zero or more `Message`s. Each message has a unique identifier b in a format specific to each given mailbox. This identifier may or may not be persistent.

Functions which return a list are encouraged -- but not guaranteed -- to do so lazily.

Implementing classes must provide, at minimum, `getAll`.

Methods

listIDs :: a -> IO [b]

Returns a list of all unique identifiers.

listMessageFlags :: a -> IO [(b, Flags)]

Returns a list of all unique identifiers as well as all flags.

getAll :: a -> IO [(b, Flags, Message)]

Returns a list of all messages, including their content, flags, and unique identifiers.

getMessages :: a -> [b] -> IO [(b, Flags, Message)]

Returns information about specific messages.

class MailboxReader a b => MailboxWriter a b where

Methods

appendMessages :: a -> [(Flags, Message)] -> IO [b]

deleteMessages :: a -> [b] -> IO ()

addFlags :: a -> [b] -> Flags -> IO ()

removeFlags :: a -> [b] -> Flags -> IO ()

setFlags :: a -> [b] -> Flags -> IO ()