mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-28 11:50:24 +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 ClassyPrelude.Yesod
|
||||||
import Data.Aeson (Result(..), fromJSON, withObject, (.!=), (.:?))
|
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.FileEmbed (embedFile)
|
||||||
import Data.Yaml (decodeEither', Parser)
|
import Data.Yaml (decodeEither', Parser)
|
||||||
import Data.Yaml.Config
|
import Data.Yaml.Config
|
||||||
@ -61,7 +64,11 @@ data DatabaseSettings
|
|||||||
|
|
||||||
parseDatabase
|
parseDatabase
|
||||||
:: Bool -- ^ is this dev? if so, allow default of SQLite
|
:: Bool -- ^ is this dev? if so, allow default of SQLite
|
||||||
|
#if MIN_VERSION_aeson(2,0,0)
|
||||||
|
-> KeyMap Value
|
||||||
|
#else
|
||||||
-> HashMap Text Value
|
-> HashMap Text Value
|
||||||
|
#endif
|
||||||
-> Parser DatabaseSettings
|
-> Parser DatabaseSettings
|
||||||
parseDatabase isDev o =
|
parseDatabase isDev o =
|
||||||
if isDev
|
if isDev
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user