ebook-manager/src/Configuration.hs

24 lines
594 B
Haskell
Raw Normal View History

2018-08-02 23:07:05 +03:00
{-# Language NoImplicitPrelude #-}
{-# Language DeriveGeneric #-}
{-# Language DuplicateRecordFields #-}
module Configuration where
import ClassyPrelude
import Dhall (Interpret)
data Pg = Pg { username :: Text
, password :: Text
, host :: Text
, database :: Text }
deriving (Show, Generic)
2018-08-08 23:56:16 +03:00
newtype Store = Store { path :: Text } deriving (Show, Generic)
2018-08-02 23:07:05 +03:00
2018-08-08 23:56:16 +03:00
data Config = Config { database :: Pg
, store :: Store }
deriving (Show, Generic)
2018-08-02 23:07:05 +03:00
instance Interpret Pg
2018-08-08 23:56:16 +03:00
instance Interpret Store
2018-08-02 23:07:05 +03:00
instance Interpret Config