summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlocallycompact <>2020-08-09 21:42:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2020-08-09 21:42:00 (GMT)
commit8a87cbe449421b66394d098d51744804cdea7451 (patch)
tree20b18ecb1ad49bd29e757957eca8c42792251205
parent58b5b94eef9e194fe04991deda436ede7e77172d (diff)
version 0.1.2.0HEAD0.1.2.0master
-rw-r--r--ChangeLog.md4
-rw-r--r--aeson-with.cabal4
-rw-r--r--src/Data/Aeson/With.hs2
3 files changed, 7 insertions, 3 deletions
diff --git a/ChangeLog.md b/ChangeLog.md
index e82dbfb..0ab7b0c 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,5 +1,9 @@
# Changelog for aeson-with
+## v0.1.2.0
+
+* Remove useless dependencies on `mtl` and `hashmap`.
+
## v0.1.1.0
* Add `view'` and `toListOf'` for viewing `ToJSON` instances.
diff --git a/aeson-with.cabal b/aeson-with.cabal
index 3baad51..9518a2b 100644
--- a/aeson-with.cabal
+++ b/aeson-with.cabal
@@ -5,7 +5,7 @@ cabal-version: 1.12
-- see: https://github.com/sol/hpack
name: aeson-with
-version: 0.1.1.2
+version: 0.1.2.0
synopsis: withXField combinators for aeson
description: Silly little withXField combinators for adding fields to an existing JSON value.
category: Data
@@ -34,10 +34,8 @@ library
build-depends:
aeson
, base >=4.7 && <5
- , hashmap
, lens
, lens-aeson
- , mtl
, scientific
, text
, unordered-containers
diff --git a/src/Data/Aeson/With.hs b/src/Data/Aeson/With.hs
index cb3596d..0270746 100644
--- a/src/Data/Aeson/With.hs
+++ b/src/Data/Aeson/With.hs
@@ -28,9 +28,11 @@ import Data.Semigroup
import Data.Text
import qualified Data.Vector as V
+-- | Version of `view` for any `ToJSON`.
view' :: ToJSON a => Getting c Value c -> a -> c
view' f = view f . toJSON
+-- | Version of `toListOf` for any `ToJSON`.
toListOf' :: ToJSON a1 => Getting (Endo [a2]) Value a2 -> a1 -> [a2]
toListOf' f = toListOf f . toJSON