From 52d38a0cc3d30aac2cf22fec3644cf17f908d0b8 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Tue, 5 Apr 2022 23:22:58 +0200 Subject: cwality-maps: also traverse generic aeson values this works surprisingly well, actually --- cwality-maps/Substitute.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cwality-maps/Substitute.hs b/cwality-maps/Substitute.hs index 65e8fc3..ccab272 100644 --- a/cwality-maps/Substitute.hs +++ b/cwality-maps/Substitute.hs @@ -53,7 +53,12 @@ trivial :: t -> b -> ([a], t) trivial = const . ([],) instance {-# OVERLAPS #-} Substitutable A.Value where - substitute = trivial + substitute (A.Object fields) params = + second A.Object $ traverse (`substitute` params) fields + substitute (A.String str) params = + second A.String $ substitute str params + substitute other params = ([], other) + instance Substitutable Int where substitute = trivial -- cgit v1.2.3