File tree Expand file tree Collapse file tree 1 file changed +28
-22
lines changed Expand file tree Collapse file tree 1 file changed +28
-22
lines changed Original file line number Diff line number Diff line change @@ -43,26 +43,32 @@ You can also get the inferred signature directly via `bsc -i MyFile.res`
43
43
let fib: int => int
44
44
```
45
45
46
- <!-- TODO: add this back next version. Currently not outputting res -->
47
-
48
- <!-- You can quickly test code snippets in the console: -->
49
- <!-- ``` -->
50
- <!-- ❯ bsc -e ' let add = (x, y) => x + y' -->
51
- <!-- // Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE -->
52
- <!-- ' use strict' ; -->
53
- <!-- -->
54
- <!-- -->
55
- <!-- function id(x) { -- >
56
- < ! -- return x ; -- >
57
- < ! -- } -->
58
- <!-- -->
59
- <!-- exports.id = id; -->
60
- <!-- ``` -->
61
- <!-- -->
62
- <!-- Pass the `-i` flag to infer the signature: -->
63
- <!-- -->
64
- <!-- ``` -->
65
- <!-- ❯ bsc -i -e ' let id = x => x' -->
66
- <!-- let id: ' a => ' a; -->
67
- <!-- ``` -->
46
+ You can quickly test code snippets in the console:
68
47
48
+ ```sh
49
+ ❯ bsc -e ' let add = (x, y) => x + y'
50
+ // Generated by ReScript, PLEASE EDIT WITH CARE
51
+ ' use strict' ;
52
+
53
+
54
+ function add(x, y) {
55
+ return x + y | 0 ;
56
+ }
57
+
58
+ exports.add = add;
59
+ /* No side effect */
60
+ ```
61
+
62
+ Pass the `-i` flag to infer the signature:
63
+
64
+ ```sh
65
+ ❯ bsc -i -e ' let id = x => x'
66
+ let id: ' a => ' a
67
+ ```
68
+
69
+ **To evaluate a script quickly, pipe the output to Node**:
70
+
71
+ ```sh
72
+ ❯ bsc -e ' let add = (x, y) => x + y; Js.log(add(1, 2))' | node
73
+ 3
74
+ ```
You can’t perform that action at this time.
0 commit comments