diff options
author | Gregor Kleen <aethoago@141.li> | 2017-01-26 22:10:29 +0100 |
---|---|---|
committer | Gregor Kleen <aethoago@141.li> | 2017-01-26 22:10:29 +0100 |
commit | 067c9c10e08bc48678687996945b35fa921229f4 (patch) | |
tree | d3e78984cb65a285b9c6b2c6ea29938709088289 /src/Simple.hs | |
parent | 0557c61d62bbcb01afc2f2604fa631062e034cc2 (diff) | |
download | postdelay-067c9c10e08bc48678687996945b35fa921229f4.tar postdelay-067c9c10e08bc48678687996945b35fa921229f4.tar.gz postdelay-067c9c10e08bc48678687996945b35fa921229f4.tar.bz2 postdelay-067c9c10e08bc48678687996945b35fa921229f4.tar.xz postdelay-067c9c10e08bc48678687996945b35fa921229f4.zip |
Basic concepts
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 | ||