Skip to content

Commit

Permalink
Part 7: Hook up consensus-specific diff sequence to benchmarks.
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisdral authored and jasagredo committed Dec 2, 2022
1 parent 34b77db commit a6fc72b
Show file tree
Hide file tree
Showing 8 changed files with 223 additions and 380 deletions.
4 changes: 2 additions & 2 deletions anti-diff/src/Data/Map/Diff/Strict.hs
Expand Up @@ -13,8 +13,8 @@ import Data.Map.Diff.Strict.Internal as X (Diff, DiffEntry,
DiffHistory, Keys (..), Values (..), diff, diffKeys,
forwardValues, forwardValuesAndKeys, fromList,
fromListDeletes, fromListInserts, fromSeq,
isNonEmptyHistory, restrictValues, singletonDelete,
singletonInsert, valuesFromList)
isNonEmptyHistory, keysFromList, restrictValues,
singletonDelete, singletonInsert, valuesFromList)

import qualified Data.Map.Diff.Strict.Internal as Internal

Expand Down
8 changes: 6 additions & 2 deletions anti-diff/src/Data/Map/Diff/Strict/Internal.hs
Expand Up @@ -25,6 +25,7 @@ module Data.Map.Diff.Strict.Internal (
, Keys (..)
, Values (..)
, diffKeys
, keysFromList
, restrictValues
, valuesFromList
-- * Forwarding keys and values
Expand Down Expand Up @@ -229,8 +230,11 @@ newtype Keys k v = Keys (Set k)
valuesFromList :: Ord k => [(k, v)] -> Values k v
valuesFromList = Values . Map.fromList

diffKeys :: Diff k v -> Set k
diffKeys (Diff m) = Map.keysSet m
keysFromList :: Ord k => [k] -> Keys k v
keysFromList = Keys . Set.fromList

diffKeys :: Diff k v -> Keys k v
diffKeys (Diff m) = Keys $ Map.keysSet m

restrictValues :: Ord k => Values k v -> Keys k v -> Values k v
restrictValues (Values m) (Keys s) = Values (Map.restrictKeys m s)
Expand Down

0 comments on commit a6fc72b

Please sign in to comment.