blob: 200b8fda053be174929ff6891a4e83bcc35d2ad2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
{- Lazymail monad.
-
- Copyright 2013 Raúl Benencia <rul@kalgan.cc>
-
- Licensed under the GNU GPL version 3 or higher
-
-}
module Lazymail where
import Control.Monad.Reader
import Control.Monad.State
import Config
import State
{- Lazymail monad is a ReaderT around a StateT with IO at the bottom of the
- stack.
-}
type Lazymail = ReaderT LazymailConfig (StateT LazymailState IO)
run :: Lazymail a -> IO (a, LazymailState)
run k =
let config = customConfig
state = initialState { basePath = initialPath config }
in runStateT (runReaderT k config) state
|