summaryrefslogtreecommitdiff
path: root/src/Simple.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Simple.hs')
-rw-r--r--src/Simple.hs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/Simple.hs b/src/Simple.hs
new file mode 100644
index 0000000..f461766
--- /dev/null
+++ b/src/Simple.hs
@@ -0,0 +1,24 @@
1module Main (main) where
2
3import Postdelay.Scan
4
5import Control.Monad.IO.Class
6import Control.Monad.Trans.Except
7
8
9main :: MonadIO m => m ()
10main = do
11 mailStr <- liftIO getContents
12 delay <- runExceptT $ scan mailStr
13 case delay of
14 Left err -> do
15 liftIO . putStrLn $ show err
16 sendNow mailStr
17 Right Nothing -> sendNow mailStr
18 Right (Just d) -> sendLater mailStr d
19
20sendNow :: MonadIO m => String -> m ()
21sendNow = undefined
22
23sendLater :: MonadIO m => String -> Delay -> m ()
24sendLater = undefined