Versionbump: HashMap -> KeyMap; removed redundant instances; resolved version conflicts.
This commit is contained in:
parent
fb5f19cb8d
commit
5fce01ef40
@ -27,7 +27,7 @@ dependencies:
|
||||
- directory
|
||||
- warp
|
||||
- data-default
|
||||
- aeson >=1.5
|
||||
- aeson >=2
|
||||
- conduit
|
||||
- monad-logger
|
||||
- fast-logger
|
||||
@ -186,6 +186,7 @@ dependencies:
|
||||
- haskell-src-meta
|
||||
- either
|
||||
- xlsx
|
||||
- hashable
|
||||
other-extensions:
|
||||
- GeneralizedNewtypeDeriving
|
||||
- IncoherentInstances
|
||||
|
||||
@ -18,7 +18,7 @@ import Utils.PathPiece (pathPieceJSON, pathPieceJSONKey)
|
||||
import Web.PathPieces
|
||||
|
||||
|
||||
deriving stock instance Generic StdMethod
|
||||
--deriving stock instance Generic StdMethod
|
||||
deriving anyclass instance Binary StdMethod
|
||||
deriving anyclass instance Hashable StdMethod
|
||||
|
||||
|
||||
@ -19,7 +19,8 @@ import ClassyPrelude.Yesod hiding (derivePersistFieldJSON)
|
||||
import Settings.Locale (appLanguages)
|
||||
|
||||
import qualified Data.Aeson as JSON
|
||||
import qualified Data.HashMap.Lazy as HashMap
|
||||
import qualified Data.Aeson.KeyMap as KeyMap
|
||||
--import qualified Data.HashMap.Lazy as HashMap
|
||||
|
||||
import qualified Data.Map as Map
|
||||
import qualified Data.Set as Set
|
||||
@ -89,13 +90,13 @@ instance ToJSON a => ToJSON (I18n a) where
|
||||
]
|
||||
where
|
||||
fallbackUnambiguous = case toJSON i18nFallback of
|
||||
JSON.Object hm -> not (HashMap.member "fallback" hm)
|
||||
&& not (HashMap.member "fallback-lang" hm)
|
||||
JSON.Object hm -> not (KeyMap.member "fallback" hm)
|
||||
&& not (KeyMap.member "fallback-lang" hm)
|
||||
_other -> True
|
||||
|
||||
instance FromJSON a => FromJSON (I18n a) where
|
||||
parseJSON (JSON.Object o)
|
||||
| HashMap.member "fallback" o || HashMap.member "fallback-lang" o = do
|
||||
| KeyMap.member "fallback" o || KeyMap.member "fallback-lang" o = do
|
||||
i18nFallback <- o JSON..: "fallback"
|
||||
i18nFallbackLang <- o JSON..:? "fallback-lang"
|
||||
i18nTranslations <- o JSON..:? "translations" JSON..!= Map.empty
|
||||
|
||||
@ -131,7 +131,8 @@ extra-deps:
|
||||
- bytestring-0.12.0.2@sha256:9fc077ff5b7ed2246773c3ac4370ef8822e4834d4587522b68ae551a5968fb86,7891
|
||||
- containers-0.7@sha256:e9b5fdcc609159410d408c47e0be13663bb0b4a42a5183b52aa0ac9c99e1dfec,2668
|
||||
- parsec-3.1.17.0@sha256:6cf18e59d9f1c5b40385457b82ab679dc18d3c5bd3c2c67b2f94e1e8732e6624,5119
|
||||
- pretty-1.1.3.6@sha256:e16ffc733e816cfc09e99cc7f2398805f1f4c872d238a6b81668b5527284b382,2482
|
||||
# - pretty-1.1.3.6@sha256:e16ffc733e816cfc09e99cc7f2398805f1f4c872d238a6b81668b5527284b382,2482
|
||||
- pretty-1.1.3.6
|
||||
- process-1.6.18.0@sha256:69fbbca4151e1a6d1a5da41a1e17c254871675a4f2aed5213bbdfb10b5e52742,3148
|
||||
- time-1.12.2@sha256:88e8493d9130038d3b9968a2530a0900141cd3d938483c83dde56e12b875ebc8,6510
|
||||
- unix-2.8.5.0@sha256:633f15ef0bd50a16a7b5c5e86e6659fee6e4e211e098cc8bd0029f452bfcfddc,9808
|
||||
|
||||
@ -588,7 +588,7 @@ packages:
|
||||
sha256: 9f62289797600d7121862309c306a3b495f872dccfe3d5c4bdeaf85d5ad12dd7
|
||||
size: 1308
|
||||
original:
|
||||
hackage: pretty-1.1.3.6@sha256:e16ffc733e816cfc09e99cc7f2398805f1f4c872d238a6b81668b5527284b382,2482
|
||||
hackage: pretty-1.1.3.6
|
||||
- completed:
|
||||
hackage: process-1.6.18.0@sha256:69fbbca4151e1a6d1a5da41a1e17c254871675a4f2aed5213bbdfb10b5e52742,3148
|
||||
pantry-tree:
|
||||
|
||||
Reference in New Issue
Block a user