ic-mops 0.8.5 → 0.8.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/package.json +3 -1
  2. package/.mops/base@0.7.4/LICENSE +0 -208
  3. package/.mops/base@0.7.4/README.md +0 -64
  4. package/.mops/base@0.7.4/mops.toml +0 -5
  5. package/.mops/base@0.7.4/src/Array.mo +0 -686
  6. package/.mops/base@0.7.4/src/AssocList.mo +0 -203
  7. package/.mops/base@0.7.4/src/Blob.mo +0 -55
  8. package/.mops/base@0.7.4/src/Bool.mo +0 -44
  9. package/.mops/base@0.7.4/src/Buffer.mo +0 -1937
  10. package/.mops/base@0.7.4/src/CertifiedData.mo +0 -29
  11. package/.mops/base@0.7.4/src/Char.mo +0 -67
  12. package/.mops/base@0.7.4/src/Debug.mo +0 -15
  13. package/.mops/base@0.7.4/src/Deque.mo +0 -75
  14. package/.mops/base@0.7.4/src/Error.mo +0 -41
  15. package/.mops/base@0.7.4/src/ExperimentalCycles.mo +0 -51
  16. package/.mops/base@0.7.4/src/ExperimentalInternetComputer.mo +0 -36
  17. package/.mops/base@0.7.4/src/ExperimentalStableMemory.mo +0 -121
  18. package/.mops/base@0.7.4/src/Float.mo +0 -150
  19. package/.mops/base@0.7.4/src/Func.mo +0 -38
  20. package/.mops/base@0.7.4/src/Hash.mo +0 -83
  21. package/.mops/base@0.7.4/src/HashMap.mo +0 -229
  22. package/.mops/base@0.7.4/src/Heap.mo +0 -113
  23. package/.mops/base@0.7.4/src/Int.mo +0 -150
  24. package/.mops/base@0.7.4/src/Int16.mo +0 -159
  25. package/.mops/base@0.7.4/src/Int32.mo +0 -160
  26. package/.mops/base@0.7.4/src/Int64.mo +0 -161
  27. package/.mops/base@0.7.4/src/Int8.mo +0 -160
  28. package/.mops/base@0.7.4/src/Iter.mo +0 -220
  29. package/.mops/base@0.7.4/src/IterType.mo +0 -7
  30. package/.mops/base@0.7.4/src/List.mo +0 -433
  31. package/.mops/base@0.7.4/src/Nat.mo +0 -75
  32. package/.mops/base@0.7.4/src/Nat16.mo +0 -146
  33. package/.mops/base@0.7.4/src/Nat32.mo +0 -146
  34. package/.mops/base@0.7.4/src/Nat64.mo +0 -146
  35. package/.mops/base@0.7.4/src/Nat8.mo +0 -146
  36. package/.mops/base@0.7.4/src/None.mo +0 -19
  37. package/.mops/base@0.7.4/src/Option.mo +0 -160
  38. package/.mops/base@0.7.4/src/Order.mo +0 -46
  39. package/.mops/base@0.7.4/src/Prelude.mo +0 -33
  40. package/.mops/base@0.7.4/src/Principal.mo +0 -58
  41. package/.mops/base@0.7.4/src/RBTree.mo +0 -218
  42. package/.mops/base@0.7.4/src/Random.mo +0 -188
  43. package/.mops/base@0.7.4/src/Result.mo +0 -210
  44. package/.mops/base@0.7.4/src/Stack.mo +0 -40
  45. package/.mops/base@0.7.4/src/Text.mo +0 -615
  46. package/.mops/base@0.7.4/src/Time.mo +0 -37
  47. package/.mops/base@0.7.4/src/Trie.mo +0 -1200
  48. package/.mops/base@0.7.4/src/TrieMap.mo +0 -180
  49. package/.mops/base@0.7.4/src/TrieSet.mo +0 -97
  50. package/.mops/base@0.8.3/LICENSE +0 -208
  51. package/.mops/base@0.8.3/README.md +0 -64
  52. package/.mops/base@0.8.3/mops.toml +0 -6
  53. package/.mops/base@0.8.3/src/Array.mo +0 -717
  54. package/.mops/base@0.8.3/src/AssocList.mo +0 -404
  55. package/.mops/base@0.8.3/src/Blob.mo +0 -212
  56. package/.mops/base@0.8.3/src/Bool.mo +0 -44
  57. package/.mops/base@0.8.3/src/Buffer.mo +0 -2660
  58. package/.mops/base@0.8.3/src/CertifiedData.mo +0 -53
  59. package/.mops/base@0.8.3/src/Char.mo +0 -65
  60. package/.mops/base@0.8.3/src/Debug.mo +0 -56
  61. package/.mops/base@0.8.3/src/Deque.mo +0 -243
  62. package/.mops/base@0.8.3/src/Error.mo +0 -68
  63. package/.mops/base@0.8.3/src/ExperimentalCycles.mo +0 -151
  64. package/.mops/base@0.8.3/src/ExperimentalInternetComputer.mo +0 -60
  65. package/.mops/base@0.8.3/src/ExperimentalStableMemory.mo +0 -348
  66. package/.mops/base@0.8.3/src/Float.mo +0 -843
  67. package/.mops/base@0.8.3/src/Func.mo +0 -46
  68. package/.mops/base@0.8.3/src/Hash.mo +0 -82
  69. package/.mops/base@0.8.3/src/HashMap.mo +0 -457
  70. package/.mops/base@0.8.3/src/Heap.mo +0 -233
  71. package/.mops/base@0.8.3/src/Int.mo +0 -365
  72. package/.mops/base@0.8.3/src/Int16.mo +0 -521
  73. package/.mops/base@0.8.3/src/Int32.mo +0 -522
  74. package/.mops/base@0.8.3/src/Int64.mo +0 -522
  75. package/.mops/base@0.8.3/src/Int8.mo +0 -522
  76. package/.mops/base@0.8.3/src/Iter.mo +0 -227
  77. package/.mops/base@0.8.3/src/IterType.mo +0 -7
  78. package/.mops/base@0.8.3/src/List.mo +0 -930
  79. package/.mops/base@0.8.3/src/Nat.mo +0 -305
  80. package/.mops/base@0.8.3/src/Nat16.mo +0 -144
  81. package/.mops/base@0.8.3/src/Nat32.mo +0 -144
  82. package/.mops/base@0.8.3/src/Nat64.mo +0 -144
  83. package/.mops/base@0.8.3/src/Nat8.mo +0 -144
  84. package/.mops/base@0.8.3/src/None.mo +0 -19
  85. package/.mops/base@0.8.3/src/Option.mo +0 -154
  86. package/.mops/base@0.8.3/src/Order.mo +0 -46
  87. package/.mops/base@0.8.3/src/Prelude.mo +0 -33
  88. package/.mops/base@0.8.3/src/Principal.mo +0 -249
  89. package/.mops/base@0.8.3/src/RBTree.mo +0 -681
  90. package/.mops/base@0.8.3/src/Random.mo +0 -270
  91. package/.mops/base@0.8.3/src/Result.mo +0 -209
  92. package/.mops/base@0.8.3/src/Stack.mo +0 -93
  93. package/.mops/base@0.8.3/src/Text.mo +0 -761
  94. package/.mops/base@0.8.3/src/Time.mo +0 -36
  95. package/.mops/base@0.8.3/src/Timer.mo +0 -62
  96. package/.mops/base@0.8.3/src/Trie.mo +0 -1603
  97. package/.mops/base@0.8.3/src/TrieMap.mo +0 -392
  98. package/.mops/base@0.8.3/src/TrieSet.mo +0 -148
  99. package/network.txt +0 -1
@@ -1,36 +0,0 @@
1
- /// System time
2
-
3
- import Prim "mo:⛔";
4
- module {
5
-
6
- /// System time is represent as nanoseconds since 1970-01-01.
7
- public type Time = Int;
8
-
9
- /// Current system time given as nanoseconds since 1970-01-01. The system guarantees that:
10
- ///
11
- /// * the time, as observed by the canister smart contract, is monotonically increasing, even across canister upgrades.
12
- /// * within an invocation of one entry point, the time is constant.
13
- ///
14
- /// The system times of different canisters are unrelated, and calls from one canister to another may appear to travel "backwards in time"
15
- ///
16
- /// Note: While an implementation will likely try to keep the system time close to the real time, this is not formally guaranteed.
17
- public let now : () -> Time = func() : Int = Prim.nat64ToNat(Prim.time());
18
- ///
19
- /// The following example illustrates using the system time:
20
- ///
21
- /// ```motoko
22
- /// import Int = "mo:base/Int";
23
- /// import Time = "mo:base/Time";
24
- ///
25
- /// actor {
26
- /// var lastTime = Time.now();
27
- /// public func greet(name : Text) : async Text {
28
- /// let now = Time.now();
29
- /// let elapsedSeconds = (now - lastTime) / 1000_000_000;
30
- /// lastTime := now;
31
- /// return "Hello, " # name # "!" #
32
- /// " I was last called " # Int.toText(elapsedSeconds) # " seconds ago";
33
- /// };
34
- /// };
35
- /// ```
36
- }
@@ -1,62 +0,0 @@
1
- /// Timers for one-off or periodic tasks.
2
- ///
3
- /// Note: If `moc` is invoked with `-no-timer`, the importing will fail.
4
- /// Note: The resolution of the timers is in the order of the block rate,
5
- /// so durations should be chosen well above that. For frequent
6
- /// canister wake-ups the heatbeat mechanism should be considered.
7
-
8
- import { setTimer = setTimerNano; cancelTimer = cancel } = "mo:⛔";
9
- import { fromIntWrap } = "Nat64";
10
-
11
- module {
12
-
13
- public type Duration = { #seconds : Nat; #nanoseconds : Nat };
14
- public type TimerId = Nat;
15
-
16
- func toNanos(d : Duration) : Nat64 =
17
- fromIntWrap (switch d {
18
- case (#seconds s) s * 1000_000_000;
19
- case (#nanoseconds ns) ns });
20
-
21
- /// Installs a one-off timer that upon expiration after given duration `d`
22
- /// executes the future `job()`.
23
- ///
24
- /// ```motoko no-repl
25
- /// let now = Time.now();
26
- /// let thirtyMinutes = 1_000_000_000 * 60 * 30;
27
- /// func alarmUser() : async () {
28
- /// // ...
29
- /// };
30
- /// appt.reminder = setTimer(#nanoseconds (Int.abs(appt.when - now - thirtyMinutes)), alarmUser);
31
- /// ```
32
- public func setTimer(d : Duration, job : () -> async ()) : TimerId {
33
- setTimerNano(toNanos d, false, job)
34
- };
35
-
36
- /// Installs a recurring timer that upon expiration after given duration `d`
37
- /// executes the future `job()` and reinserts itself for another expiration.
38
- ///
39
- /// Note: A duration of 0 will only expire once.
40
- ///
41
- /// ```motoko no-repl
42
- /// func checkAndWaterPlants() : async () {
43
- /// // ...
44
- /// };
45
- /// let daily = recurringTimer(#seconds (24 * 60 * 60), checkAndWaterPlants);
46
- /// ```
47
- public func recurringTimer(d : Duration, job : () -> async ()) : TimerId {
48
- setTimerNano(toNanos d, true, job)
49
- };
50
-
51
- /// Cancels a still active timer with `(id : TimerId)`. For expired timers
52
- /// and not recognised `id`s nothing happens.
53
- ///
54
- /// ```motoko no-repl
55
- /// func deleteAppt(appt : Appointment) {
56
- /// cancelTimer (appt.reminder);
57
- /// // ...
58
- /// };
59
- /// ```
60
- public let cancelTimer : TimerId -> () = cancel;
61
-
62
- }