mustache 2.3.2 → 2.4.0
raw patch · 3 files changed
+15/−3 lines, 3 filesdep ~aeson
Dependency ranges changed: aeson
Files
- CHANGELOG.md +4/−0
- mustache.cabal +2/−2
- src/Text/Mustache/Internal/Types.hs +9/−1
CHANGELOG.md view
@@ -1,5 +1,9 @@ # Mustache library changelog +## v2.4.0++- Support for aeson 2+ ## v2.3.2 - Added support for GHC 9.0.1
mustache.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: mustache-version: 2.3.2+version: 2.4.0 synopsis: A mustache template parser library. description: Allows parsing and rendering template files with mustache markup. See the mustache <http://mustache.github.io/mustache.5.html language reference>.@@ -18,7 +18,7 @@ bug-reports: https://github.com/JustusAdam/mustache/issues author: Justus Adam maintainer: dev@justus.science-copyright: (c) 2015 - 2019 Justus Adam+copyright: (c) 2015 - 2022 Justus Adam license: BSD3 license-file: LICENSE build-type: Simple
src/Text/Mustache/Internal/Types.hs view
@@ -12,6 +12,9 @@ import Control.Arrow import Control.Monad.RWS hiding (lift) import qualified Data.Aeson as Aeson+#if MIN_VERSION_aeson(2,0,0)+import qualified Data.Aeson.KeyMap as KM+#endif import Data.Int (Int8, Int16, Int32, Int64) import Data.Foldable (toList) import qualified Data.HashMap.Strict as HM@@ -269,7 +272,12 @@ toMustache = Lambda instance ToMustache Aeson.Value where- toMustache (Aeson.Object o) = Object $ fmap toMustache o+ toMustache (Aeson.Object o) = Object $ fmap toMustache+#if MIN_VERSION_aeson(2,0,0)+ (KM.toHashMapText o)+#else+ o+#endif toMustache (Aeson.Array a) = Array $ fmap toMustache a toMustache (Aeson.Number n) = Number n toMustache (Aeson.String s) = String s