diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Main.hs | 4 | ||||
-rw-r--r-- | src/Simple.hs | 24 |
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 @@ | |||
1 | module Main where | ||
2 | |||
3 | main :: IO () | ||
4 | main = 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 @@ | |||
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 | ||