module Web.Postie.Types(
HandlerResponse(..)
, Mail(..)
, Application
, SessionID(..)
) where
import Web.Postie.Address
import Data.UUID
import Data.Typeable (Typeable)
import Data.ByteString (ByteString)
import Pipes (Producer)
newtype SessionID = SessionID { toUUID :: UUID }
deriving (Eq, Ord, Typeable)
instance Show SessionID where
show = show . toUUID
data HandlerResponse = Accepted
| Rejected
data Mail = Mail {
mailSessionID :: SessionID
, mailSender :: Address
, mailRecipients :: [Address]
, mailBody :: Producer ByteString IO ()
}
type Application = Mail -> IO HandlerResponse