-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DMS-68] Deduplicate switch cases using or-patterns #29
base: milestone-2
Are you sure you want to change the base?
Commits on Sep 30, 2024
-
Extract persistent RBTree from mutable wrapper into a separate module
No changes in logic so far, just simple refactoring
Configuration menu - View commit details
-
Copy full SHA for c268695 - Browse repository at this point
Copy the full SHA c268695View commit details -
[DMS-66] Extend API for persistent ordered map
Add `MapOps` class with the following signature: public class MapOps<K>(compare : (K,K) -> O.Order) { public func put<V>(rbMap : Map<K, V>, key : K, value : V) : Map<K, V> public func fromIter<V>(i : I.Iter<(K,V)>) : Map<K, V> public func replace<V>(rbMap : Map<K, V>, key : K, value : V) : (Map<K,V>, ?V) public func mapFilter<V1, V2>(f : (K, V1) -> ?V2, rbMap : Map<K, V1>) : Map<K, V2> public func get<V>(key : K, rbMap : Map<K, V>) : ?V public func delete<V>(rbMap : Map<K, V>, key : K) : Map<K, V> public func remove< V>(rbMap : Map<K, V>, key : K) : (Map<K,V>, ?V) }; The other functionality provided as standalone functions, as they don't require comparator: public type Direction = { #fwd; #bwd }; public func iter<K, V>(rbMap : Map<K, V>, direction : Direction) : I.Iter<(K, V)> public func entries<K, V>(m : Map<K, V>) : I.Iter<(K, V)> public func keys<K, V>(m : Map<K, V>, direction : Direction) : I.Iter<K> public func vals<K, V>(m : Map<K, V>, direction : Direction) : I.Iter<V> public func map<K, V1, V2>(f : (K, V1) -> V2, rbMap : Map<K, V1>) : Map<K, V2> public func size<K, V>(t : Map<K, V>) : Nat public func foldLeft<Key, Value, Accum>( combine : (Key, Value, Accum) -> Accum, base : Accum, rbMap : Map<Key, Value> ) : Accum And foldRight with the same signature as foldLeft The following functions are new for the API: - MapOps.put, MapOps.delete - MapOps.fromIter, entries, keys, vals - MapOps.mapFilter, map - foldLeft, foldRight
Configuration menu - View commit details
-
Copy full SHA for e9d9ab6 - Browse repository at this point
Copy the full SHA e9d9ab6View commit details -
[DMS-66] fix order of method arguments
Problem: now order is not consistent within new module and with old modules as well. Solution: make the map argument always go first
Configuration menu - View commit details
-
Copy full SHA for 614fa56 - Browse repository at this point
Copy the full SHA 614fa56View commit details -
[DMS-76] Persistent ordered map unit testing
In addition to tests this patch removes `direction` argument from `keys` and `values` function to keep them simple and provides a new function `Map.empty` to create a map without knowing its internal representation.
Configuration menu - View commit details
-
Copy full SHA for ffdad00 - Browse repository at this point
Copy the full SHA ffdad00View commit details -
Configuration menu - View commit details
-
Copy full SHA for 89b7f6d - Browse repository at this point
Copy the full SHA 89b7f6dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 41b6516 - Browse repository at this point
Copy the full SHA 41b6516View commit details
Commits on Oct 2, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 09fd7d0 - Browse repository at this point
Copy the full SHA 09fd7d0View commit details -
Merge pull request #8 from serokell/wip/s-and-witch/fix-doc
Specify keys order in iterators
Configuration menu - View commit details
-
Copy full SHA for fcae5a6 - Browse repository at this point
Copy the full SHA fcae5a6View commit details
Commits on Oct 7, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 40208d0 - Browse repository at this point
Copy the full SHA 40208d0View commit details
Commits on Oct 14, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 38d7bd2 - Browse repository at this point
Copy the full SHA 38d7bd2View commit details -
Configuration menu - View commit details
-
Copy full SHA for a26ad5d - Browse repository at this point
Copy the full SHA a26ad5dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9e25663 - Browse repository at this point
Copy the full SHA 9e25663View commit details -
Configuration menu - View commit details
-
Copy full SHA for d65c36c - Browse repository at this point
Copy the full SHA d65c36cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2d87094 - Browse repository at this point
Copy the full SHA 2d87094View commit details
Commits on Oct 15, 2024
-
Move leaf branch to the end of switch expression, as the most unlikely
This PR didn't touch folds and map as benchmark showed us that it performs worse.
Configuration menu - View commit details
-
Copy full SHA for 86b876f - Browse repository at this point
Copy the full SHA 86b876fView commit details
Commits on Oct 18, 2024
-
Configuration menu - View commit details
-
Copy full SHA for d4eac36 - Browse repository at this point
Copy the full SHA d4eac36View commit details