mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-11 19:58:28 +01:00
Compatibility with newer aeson
This commit is contained in:
parent
25e12579dd
commit
03ca4b5255
@ -11,6 +11,9 @@ module Settings where
|
||||
|
||||
import ClassyPrelude.Yesod
|
||||
import Data.Aeson (Result(..), fromJSON, withObject, (.!=), (.:?))
|
||||
#if MIN_VERSION_aeson(2,0,0)
|
||||
import Data.Aeson.KeyMap (KeyMap)
|
||||
#endif
|
||||
import Data.FileEmbed (embedFile)
|
||||
import Data.Yaml (decodeEither', Parser)
|
||||
import Data.Yaml.Config
|
||||
@ -61,7 +64,11 @@ data DatabaseSettings
|
||||
|
||||
parseDatabase
|
||||
:: Bool -- ^ is this dev? if so, allow default of SQLite
|
||||
#if MIN_VERSION_aeson(2,0,0)
|
||||
-> KeyMap Value
|
||||
#else
|
||||
-> HashMap Text Value
|
||||
#endif
|
||||
-> Parser DatabaseSettings
|
||||
parseDatabase isDev o =
|
||||
if isDev
|
||||
|
||||
Loading…
Reference in New Issue
Block a user