summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Main.hs4
-rw-r--r--src/Simple.hs24
2 files changed, 24 insertions, 4 deletions
diff --git a/src/Main.hs b/src/Main.hs
deleted file mode 100644
index 65ae4a0..0000000
--- a/src/Main.hs
+++ /dev/null
@@ -1,4 +0,0 @@
1module Main where
2
3main :: IO ()
4main = putStrLn "Hello, Haskell!"
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