diff options
Diffstat (limited to 'src/Simple.hs')
-rw-r--r-- | src/Simple.hs | 24 |
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 @@ | |||
1 | module Main (main) where | ||
2 | |||
3 | import Postdelay.Scan | ||
4 | |||
5 | import Control.Monad.IO.Class | ||
6 | import Control.Monad.Trans.Except | ||
7 | |||
8 | |||
9 | main :: MonadIO m => m () | ||
10 | main = 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 | |||
20 | sendNow :: MonadIO m => String -> m () | ||
21 | sendNow = undefined | ||
22 | |||
23 | sendLater :: MonadIO m => String -> Delay -> m () | ||
24 | sendLater = undefined | ||