motoko-base
motoko-base copied to clipboard
The Motoko base library
Useful to use in postupgrade in combination with `buffer.toArray()` in preupgrade
Inspired by Java's [TreeMap#tailMap](https://docs.oracle.com/javase/8/docs/api/java/util/TreeMap.html#tailMap-K-) method but this one automatically gives you an iterator. The use case is cursor pagination through a long list. I've been trying to implement cursor pagination...
this is to demonstrate what I meant in https://github.com/dfinity/motoko-base/pull/300#issuecomment-960249353 and https://github.com/dfinity/motoko-base/pull/299#issuecomment-959799801, and how to introduce this without breaking changes (although it’s kinda ugly) What I would _want_ here is to...
An outgrowth the the discussion in #299 A non-OO, `stable` version of our (currently OO) `HashMap` implementation.
Addresses #298
I'm not sure how to go about testing, but I tried to add tests as well. This same pattern can be followed for the hard edged NatXz. The Nat to...
Binary relation representation for base library, as: - Module with purely-functional representation (`Rel`) - Module with OO wrapper and useful idioms for a canister state's relations (`RelObj`), as in CanCan....
Appending a buffer with itself causes divergence, which may surprise or disappoint some developers. Possible fixes: 1. Keep same behavior (diverge) 2. Check for this case and trap, failing fast,...
Wasn't sure if this existed already
This PR points to the latest release that @kritzcreek has produced. Now, in another step, we should do a release for 0.6.0 soon. I also added a note that would...