aboutsummaryrefslogtreecommitdiff
path: root/Lazymail.hs
blob: fbb7e3e5a4bcaa6c6b2fe33adebf222c3f620b69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{- 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
import Types

run :: Lazymail a -> IO (a, LazymailState)
run k =
  let config = customConfig
      state  = initialState { basePath = initialPath config }
  in runStateT (runReaderT k config) state
nihil fit ex nihilo