From 067c9c10e08bc48678687996945b35fa921229f4 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 26 Jan 2017 22:10:29 +0100 Subject: Basic concepts --- src/Simple.hs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/Simple.hs (limited to 'src/Simple.hs') 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 @@ +module Main (main) where + +import Postdelay.Scan + +import Control.Monad.IO.Class +import Control.Monad.Trans.Except + + +main :: MonadIO m => m () +main = do + mailStr <- liftIO getContents + delay <- runExceptT $ scan mailStr + case delay of + Left err -> do + liftIO . putStrLn $ show err + sendNow mailStr + Right Nothing -> sendNow mailStr + Right (Just d) -> sendLater mailStr d + +sendNow :: MonadIO m => String -> m () +sendNow = undefined + +sendLater :: MonadIO m => String -> Delay -> m () +sendLater = undefined -- cgit v1.2.3