aboutsummaryrefslogtreecommitdiffstats
path: root/src/Data/JLD/Flattening
diff options
context:
space:
mode:
authorVolpeon <github@volpeon.ink>2023-06-24 08:58:22 +0200
committerVolpeon <github@volpeon.ink>2023-06-24 08:58:22 +0200
commitb19440a4a30828f12f8eafaa7292152ecf733334 (patch)
tree00210fae1f860d76bb5319d10167d744c5d4037d /src/Data/JLD/Flattening
parentSmall code optimization (diff)
downloadhs-jsonld-b19440a4a30828f12f8eafaa7292152ecf733334.tar.gz
hs-jsonld-b19440a4a30828f12f8eafaa7292152ecf733334.tar.bz2
hs-jsonld-b19440a4a30828f12f8eafaa7292152ecf733334.zip
WIP: Compaction
Diffstat (limited to 'src/Data/JLD/Flattening')
-rw-r--r--src/Data/JLD/Flattening/NodeMap.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Data/JLD/Flattening/NodeMap.hs b/src/Data/JLD/Flattening/NodeMap.hs
index 06af2d4..ef09757 100644
--- a/src/Data/JLD/Flattening/NodeMap.hs
+++ b/src/Data/JLD/Flattening/NodeMap.hs
@@ -18,7 +18,7 @@ import Data.Aeson.Key qualified as K (toText)
18import Data.Aeson.KeyMap qualified as KM (filterWithKey, insert, lookup, member, singleton) 18import Data.Aeson.KeyMap qualified as KM (filterWithKey, insert, lookup, member, singleton)
19import Data.Foldable.WithIndex (FoldableWithIndex (..), iforM_) 19import Data.Foldable.WithIndex (FoldableWithIndex (..), iforM_)
20import Data.Map.Strict qualified as M (insert, lookup) 20import Data.Map.Strict qualified as M (insert, lookup)
21import Data.Vector qualified as V (singleton, snoc, uniq) 21import Data.Vector qualified as V (snoc, uniq)
22 22
23type BNMT e m = REST BNMEnv (Either (JLDError e) ()) BNMState m 23type BNMT e m = REST BNMEnv (Either (JLDError e) ()) BNMState m
24 24
@@ -133,7 +133,7 @@ buildNodeMap' element = case element of
133 N.insert bnmEnvActiveGraph bnmEnvActiveSubject bnmEnvActiveProperty (Array <| V.snoc activePropertyValue element) nodeMap 133 N.insert bnmEnvActiveGraph bnmEnvActiveSubject bnmEnvActiveProperty (Array <| V.snoc activePropertyValue element) nodeMap
134 | otherwise -> nodeMap 134 | otherwise -> nodeMap
135 -- 4.2.2 135 -- 4.2.2
136 _ -> N.insert bnmEnvActiveGraph bnmEnvActiveSubject bnmEnvActiveProperty (Array <| V.singleton element) nodeMap 136 _ -> N.insert bnmEnvActiveGraph bnmEnvActiveSubject bnmEnvActiveProperty (Array <| pure element) nodeMap
137 -- 4.2. 137 -- 4.2.
138 Just list -> bnmModifyList <. const <. Just <| V.snoc list element 138 Just list -> bnmModifyList <. const <. Just <| V.snoc list element
139 -- 5. 139 -- 5.