HackMail-0.0: A Procmail Replacement as Haskell EDSLSource codeContentsIndex
HackMail.Data.Deliverable
Description

Author : Joe Fredette License : BSD3 Copyright : Joe Fredette

Maintainer : Joe Fredette jfredett.at.gmail.dot.com Stability : Unstable Portability : Portable

Synopsis
class Typeable a => Deliverable a where
deliverIO :: a -> IO ()
construct :: Email -> Path -> a
data DEMail = DE {
email :: Email
path :: Path
}
newtype FlatEmail = Flat DEMail
newtype MaildirEmail = MD DEMail
getDeliveryPath :: DEMail -> FilePath
data ToDelivery where
Wrap :: Deliverable a => a -> ToDelivery
delivery :: ToDelivery -> IO ()
Documentation
class Typeable a => Deliverable a whereSource
The main class which abstracts over delivery of datatype to somewhere in the file system. It also abstracts over construction. Due to some weirdity w.r.t. Hint, this, and all instancing datatypes, must derive Typeable. A bit of boilerplate, but deriving generally handles it easily.
Methods
deliverIO :: a -> IO ()Source
construct :: Email -> Path -> aSource
show/hide Instances
data DEMail Source
Constructors
DE
email :: Email
path :: Path
show/hide Instances
newtype FlatEmail Source
Constructors
Flat DEMail
show/hide Instances
newtype MaildirEmail Source
Constructors
MD DEMail
show/hide Instances
getDeliveryPath :: DEMail -> FilePathSource
data ToDelivery whereSource
Constructors
Wrap :: Deliverable a => a -> ToDelivery
show/hide Instances
delivery :: ToDelivery -> IO ()Source
Produced by Haddock version 2.6.1