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