ebook-manager/src/Types.hs

22 lines
581 B
Haskell
Raw Normal View History

2018-08-02 22:32:23 +03:00
{-# Language NoImplicitPrelude #-}
2018-08-02 23:59:08 +03:00
{-# Language DeriveGeneric #-}
2018-08-03 23:36:38 +03:00
{-# Language TypeSynonymInstances #-}
{-# Language FlexibleInstances #-}
2018-08-02 22:32:23 +03:00
module Types where
import ClassyPrelude
import Control.Monad.Logger
2018-08-02 23:07:05 +03:00
import Configuration
2018-08-02 23:59:08 +03:00
import Data.Pool (Pool)
import Database.Selda.Backend (SeldaConnection)
2018-08-03 23:36:38 +03:00
import Crypto.Random.Types (MonadRandom(..))
2018-08-02 22:32:23 +03:00
2018-08-02 23:59:08 +03:00
data App = App { config :: Config
, database :: Pool SeldaConnection }
deriving (Generic)
2018-08-02 22:32:23 +03:00
type AppM = LoggingT (ReaderT App IO)
2018-08-03 23:36:38 +03:00
instance MonadRandom AppM where
getRandomBytes = lift . lift . getRandomBytes