-
Notifications
You must be signed in to change notification settings - Fork 99
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
Serokell: [Milestone-1] New PersistentOrderedMap.mo lib #654
Commits on Oct 21, 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 d97833b - Browse repository at this point
Copy the full SHA d97833bView 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 14b886f - Browse repository at this point
Copy the full SHA 14b886fView 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 564f95a - Browse repository at this point
Copy the full SHA 564f95aView 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 174e877 - Browse repository at this point
Copy the full SHA 174e877View commit details -
Configuration menu - View commit details
-
Copy full SHA for 92925ab - Browse repository at this point
Copy the full SHA 92925abView commit details -
Configuration menu - View commit details
-
Copy full SHA for af994d6 - Browse repository at this point
Copy the full SHA af994d6View commit details -
Configuration menu - View commit details
-
Copy full SHA for e040734 - Browse repository at this point
Copy the full SHA e040734View commit details -
Configuration menu - View commit details
-
Copy full SHA for 070673f - Browse repository at this point
Copy the full SHA 070673fView commit details -
Configuration menu - View commit details
-
Copy full SHA for ef13759 - Browse repository at this point
Copy the full SHA ef13759View commit details -
PerisistentOrderedMap: fix docs
* rename `rbMap` into `m` in signature for brevity & consistent language * rename `rbMap` into `map` in examples for brevity & encapsulation sake * rename `tree` into `map` in doc comments for the encapsulation sake
Configuration menu - View commit details
-
Copy full SHA for d4b02eb - Browse repository at this point
Copy the full SHA d4b02ebView commit details
Commits on Oct 24, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 26a33c1 - Browse repository at this point
Copy the full SHA 26a33c1View commit details