@grain/stdlib 0.4.4 → 0.4.5

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.
package/sys/process.gr CHANGED
@@ -15,11 +15,15 @@ import WasmI32, {
15
15
  and as (&),
16
16
  eq as (==),
17
17
  ne as (!=),
18
- ltS as (<)
18
+ ltS as (<),
19
19
  } from "runtime/unsafe/wasmi32"
20
20
  import Memory from "runtime/unsafe/memory"
21
21
  import Wasi from "runtime/wasi"
22
- import { tagSimpleNumber, allocateArray, allocateString } from "runtime/dataStructures"
22
+ import {
23
+ tagSimpleNumber,
24
+ allocateArray,
25
+ allocateString,
26
+ } from "runtime/dataStructures"
23
27
 
24
28
  /**
25
29
  * @section Types: Type declarations included in the Sys/Process module.
@@ -91,13 +95,13 @@ export enum Signal {
91
95
  * @section Values: Functions and constants included in the Sys/Process module.
92
96
  */
93
97
 
94
- let wasmSafeOk = (val) => {
98
+ let wasmSafeOk = val => {
95
99
  Memory.incRef(WasmI32.fromGrain(Ok))
96
100
  Memory.incRef(WasmI32.fromGrain(val))
97
101
  Ok(val)
98
102
  }
99
103
 
100
- let wasmSafeErr = (err) => {
104
+ let wasmSafeErr = err => {
101
105
  Memory.incRef(WasmI32.fromGrain(Err))
102
106
  Memory.incRef(WasmI32.fromGrain(err))
103
107
  Err(err)
@@ -150,7 +154,7 @@ export let rec argv = () => {
150
154
  Memory.free(argvPtr)
151
155
  Memory.free(argvBufPtr)
152
156
 
153
- wasmSafeOk(WasmI32.toGrain(arr): Array<String>)
157
+ wasmSafeOk(WasmI32.toGrain(arr): (Array<String>))
154
158
  }
155
159
  }
156
160
  Memory.decRef(WasmI32.fromGrain(argv))
@@ -204,7 +208,7 @@ export let rec env = () => {
204
208
  Memory.free(envvPtr)
205
209
  Memory.free(envvBufPtr)
206
210
 
207
- wasmSafeOk(WasmI32.toGrain(arr): Array<String>)
211
+ wasmSafeOk(WasmI32.toGrain(arr): (Array<String>))
208
212
  }
209
213
  }
210
214
  Memory.decRef(WasmI32.fromGrain(env))
package/sys/random.gr CHANGED
@@ -5,10 +5,7 @@
5
5
  * @example import Random from "sys/random"
6
6
  */
7
7
 
8
- import WasmI32, {
9
- eq as (==),
10
- ne as (!=)
11
- } from "runtime/unsafe/wasmi32"
8
+ import WasmI32, { eq as (==), ne as (!=) } from "runtime/unsafe/wasmi32"
12
9
  import Memory from "runtime/unsafe/memory"
13
10
  import Wasi from "runtime/wasi"
14
11
  import { tagSimpleNumber } from "runtime/dataStructures"
@@ -17,13 +14,13 @@ import { tagSimpleNumber } from "runtime/dataStructures"
17
14
  * @section Values: Functions and constants included in the Sys/Random module.
18
15
  */
19
16
 
20
- let wasmSafeOk = (val) => {
17
+ let wasmSafeOk = val => {
21
18
  Memory.incRef(WasmI32.fromGrain(Ok))
22
19
  Memory.incRef(WasmI32.fromGrain(val))
23
20
  Ok(val)
24
21
  }
25
22
 
26
- let wasmSafeErr = (err) => {
23
+ let wasmSafeErr = err => {
27
24
  Memory.incRef(WasmI32.fromGrain(Err))
28
25
  Memory.incRef(WasmI32.fromGrain(err))
29
26
  Err(err)
package/sys/time.gr CHANGED
@@ -8,7 +8,7 @@
8
8
  import WasmI32, {
9
9
  add as (+),
10
10
  eq as (==),
11
- ne as (!=)
11
+ ne as (!=),
12
12
  } from "runtime/unsafe/wasmi32"
13
13
  import Memory from "runtime/unsafe/memory"
14
14
  import Wasi from "runtime/wasi"
@@ -19,13 +19,13 @@ import { allocateInt64, tagSimpleNumber } from "runtime/dataStructures"
19
19
  * @section Values: Functions and constants included in the Sys/Time module.
20
20
  */
21
21
 
22
- let wasmSafeOk = (val) => {
22
+ let wasmSafeOk = val => {
23
23
  Memory.incRef(WasmI32.fromGrain(Ok))
24
24
  Memory.incRef(WasmI32.fromGrain(val))
25
25
  Ok(val)
26
26
  }
27
27
 
28
- let wasmSafeErr = (err) => {
28
+ let wasmSafeErr = err => {
29
29
  Memory.incRef(WasmI32.fromGrain(Err))
30
30
  Memory.incRef(WasmI32.fromGrain(err))
31
31
  Err(err)