This commit is contained in:
Mats Rauhala 2018-12-20 00:33:32 +02:00
parent 6767813879
commit c45ea0ecc8
2 changed files with 42 additions and 16 deletions

View File

@ -0,0 +1,26 @@
{-# 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)
data Store = Filestore { path :: Text }
| IPFS { common :: Text }
deriving (Show, Generic)
data Config = Config { database :: Pg
, store :: Store }
deriving (Show, Generic)
instance Interpret Pg
instance Interpret Store
instance Interpret Config

View File

@ -29,19 +29,19 @@ library
, RecordWildCards , RecordWildCards
default-language: Haskell2010 default-language: Haskell2010
test-suite spec -- test-suite spec
type: exitcode-stdio-1.0 -- type: exitcode-stdio-1.0
main-is: Spec.hs -- main-is: Spec.hs
hs-source-dirs: src -- hs-source-dirs: src
build-depends: base >=4.10 -- build-depends: base >=4.10
, classy-prelude -- , classy-prelude
, foreign-store -- , foreign-store
, generic-lens -- , generic-lens
, lens -- , lens
, mtl -- , mtl
, text -- , text
, transformers -- , transformers
, validity -- , validity
, genvalidity-hspec -- , genvalidity-hspec
, genvalidity-property -- , genvalidity-property
, hspec -- , hspec