repo stringlengths 5 53 | pr_number int32 1 321k | task_type stringclasses 2
values | issue_text stringlengths 0 81.2k | pr_title stringlengths 1 319 | pr_body stringlengths 0 105k | base_sha stringlengths 40 40 | head_sha stringlengths 40 40 | gold_diff stringlengths 0 202M | changed_files listlengths 0 100 | review_threads listlengths 0 100 | test_patch stringlengths 0 23.4M | merged bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
Hardt-Coded/Terminal.Gui.Elmish | 5 | issue_to_patch | Releases/0.1.3 | released version 0.1.3
* fixed delete/backspace error
* Program.quit available for exiting program | 371d202440c8257db09dfe8b9e55d8a0cc72e5fc | 9872b43067bf10600cb71cd81bedc8c0a15e2d2a | diff --git a/.paket/Paket.Restore.targets b/.paket/Paket.Restore.targets
index 0df24f9..52f41c6 100644
--- a/.paket/Paket.Restore.targets
+++ b/.paket/Paket.Restore.targets
@@ -65,8 +65,6 @@
<!-- Disable Paket restore under NCrunch build -->
<PaketRestoreDisabled Condition="'$(NCrunch)' == '1'">True</PaketR... | [
".paket/Paket.Restore.targets",
".travis.yml",
"RELEASE_NOTES.md",
"appveyor.yml",
"build.proj",
"build.sh",
"docs/reference/terminal-gui-elmish-cmd-1.html",
"docs/reference/terminal-gui-elmish-cmd-ofasync.html",
"docs/reference/terminal-gui-elmish-cmd-offunc.html",
"docs/reference/terminal-gui-el... | [] | true | ||
Hardt-Coded/Terminal.Gui.Elmish | 1 | issue_to_patch | Use synthax highlights in the README.md | Hello,
this is a proposition in order to make it a bit easier to read the code. | cf15fad985fce50736fe4ab0bc0fb1a7361511a5 | c905416ab1e9aee3199284fc39c3e5fcfa55fb32 | diff --git a/README.md b/README.md
index 39bc70a..ed396b0 100644
--- a/README.md
+++ b/README.md
@@ -5,14 +5,14 @@ An elmish wrapper around Miguel de Icaza's 'Gui.cs' https://github.com/migueldei
Usage:
-```
+```fs
Program.mkConsoleProgram init update view
|> Program.run
```
Some fable-elmish DSL:
-`... | [
"README.md"
] | [] | true | ||
HigherOrderCO/Bend | 751 | issue_to_patch | The default is the C compiler but README is inconsistant | Basically the title | 58372e05fb96ec228cd09310f6a6418f1967a48f | 0b440819f6f6622a02f1ab2ac5c294abc1459559 | diff --git a/README.md b/README.md
index 64a2cdbb..9e78f075 100644
--- a/README.md
+++ b/README.md
@@ -119,7 +119,7 @@ def main():
##### Running the file
You can run it using Rust interpreter (Sequential)
```sh
-bend run sequential_sum.bend -s
+bend run-rs sequential_sum.bend -s
```
Or you can run it using C int... | [
"README.md"
] | [] | true | ||
HigherOrderCO/Bend | 749 | issue_to_patch | #748 Fix signed numbers not parsing correctly after parens | 0ac443cd2f7df0b970d3bd98ea1b1d5aaf1347c1 | 7fd742b0d626aecefaa62773230be1e936b51518 | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 771cd93f..35f6cecf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,7 @@ and this project does not currently adhere to a particular versioning scheme.
### Fixed
- Fix type checker not properly unifying all the arms of a match expression. ([#734][gh-734])
+- Fi... | [
"CHANGELOG.md",
"src/fun/parser.rs",
"tests/golden_tests/parse_file/tup_with_signed.bend",
"tests/snapshots/parse_file__tup_with_signed.bend.snap"
] | [] | diff --git a/tests/golden_tests/parse_file/tup_with_signed.bend b/tests/golden_tests/parse_file/tup_with_signed.bend
new file mode 100644
index 00000000..2de0ccd3
--- /dev/null
+++ b/tests/golden_tests/parse_file/tup_with_signed.bend
@@ -0,0 +1,9 @@
+# Test that we can parse tuples and apps beginning with signed number... | true | ||
HigherOrderCO/Bend | 747 | issue_to_patch | Update, correct, and expand documentation | ### Summary of Changes
This pull request includes the following updates and improvements:
#### **Documentation Updates**
- **Guide.md and Features.md**:
- Updated and clarified information to ensure accuracy and better readability.
- Expanded sections that were previously incomplete or unclear.
- Added ... | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/FEATURES.md b/FEATURES.md
index 8f72a2bd..ce60841f 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -8,9 +8,8 @@ To see some more complex examples programs, check out the [examples](examples/)
### Basic features
We can start with a basic program that adds the numbers 3 and 2.
-
```py
-def main:
+def main... | [
"FEATURES.md",
"GUIDE.md",
"docs/builtins.md",
"docs/cli-arguments.md",
"docs/compilation-and-readback.md",
"docs/compiler-options.md",
"docs/defining-data-types.md",
"docs/dups-and-sups.md",
"docs/ffi.md",
"docs/imports.md",
"docs/lazy-definitions.md",
"docs/native-numbers.md",
"docs/patter... | [
{
"comment": "```suggestion\r\ndef tuple_fst(x: (a, b)) -> a:\r\n```",
"path": "FEATURES.md",
"hunk": "@@ -44,7 +44,7 @@ You can bundle multiple values into a single value using a tuple or a struct.\n \n ```py\n # With a tuple\n-def tuple_fst(x):\n+def tuple_fst(x: Any) -> Any:",
"resolving_sha": "4... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | ```suggestion
def tuple_fst(x: (a, b)) -> a:
``` | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/FEATURES.md b/FEATURES.md
index 8f72a2bd..ce60841f 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -8,9 +8,8 @@ To see some more complex examples programs, check out the [examples](examples/)
### Basic features
We can start with a basic program that adds the numbers 3 and 2.
-
```py
-def main:
+def main... | [
"FEATURES.md"
] | [
{
"comment": "```suggestion\r\ndef tuple_fst(x: (a, b)) -> a:\r\n```",
"path": "FEATURES.md",
"hunk": "@@ -44,7 +44,7 @@ You can bundle multiple values into a single value using a tuple or a struct.\n \n ```py\n # With a tuple\n-def tuple_fst(x):\n+def tuple_fst(x: Any) -> Any:",
"resolving_sha": "4... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | ```suggestion
object Pair(a, b) { fst: a, snd: b }
``` | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/FEATURES.md b/FEATURES.md
index 8f72a2bd..ce60841f 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -8,9 +8,8 @@ To see some more complex examples programs, check out the [examples](examples/)
### Basic features
We can start with a basic program that adds the numbers 3 and 2.
-
```py
-def main:
+def main... | [
"FEATURES.md"
] | [
{
"comment": "```suggestion\r\nobject Pair(a, b) { fst: a, snd: b }\r\n```",
"path": "FEATURES.md",
"hunk": "@@ -53,22 +53,22 @@ def tuple_fst(x):\n # With an object (similar to what other languages call a struct, a class or a record)\n object Pair { fst, snd }",
"resolving_sha": "4979b1413f3f7afcaf... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | ```suggestion
def Pair/fst(x: Pair(a, b)) -> a:
``` | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/FEATURES.md b/FEATURES.md
index 8f72a2bd..ce60841f 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -8,9 +8,8 @@ To see some more complex examples programs, check out the [examples](examples/)
### Basic features
We can start with a basic program that adds the numbers 3 and 2.
-
```py
-def main:
+def main... | [
"FEATURES.md"
] | [
{
"comment": "```suggestion\r\ndef Pair/fst(x: Pair(a, b)) -> a:\r\n```",
"path": "FEATURES.md",
"hunk": "@@ -53,22 +53,22 @@ def tuple_fst(x):\n # With an object (similar to what other languages call a struct, a class or a record)\n object Pair { fst, snd }\n \n-def Pair/fst(x):\n+def Pair/fst(x: Pair)... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | ```suggestion
def Pair/fst_2(x: Pair(a, b)) -> a:
``` | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/FEATURES.md b/FEATURES.md
index 8f72a2bd..ce60841f 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -8,9 +8,8 @@ To see some more complex examples programs, check out the [examples](examples/)
### Basic features
We can start with a basic program that adds the numbers 3 and 2.
-
```py
-def main:
+def main... | [
"FEATURES.md"
] | [
{
"comment": "```suggestion\r\ndef Pair/fst_2(x: Pair(a, b)) -> a:\r\n```",
"path": "FEATURES.md",
"hunk": "@@ -53,22 +53,22 @@ def tuple_fst(x):\n # With an object (similar to what other languages call a struct, a class or a record)\n object Pair { fst, snd }\n \n-def Pair/fst(x):\n+def Pair/fst(x: Pai... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | Can you add a comment somewhere near the beginning of this file saying that types are optional? | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/FEATURES.md b/FEATURES.md
index 8f72a2bd..ce60841f 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -8,9 +8,8 @@ To see some more complex examples programs, check out the [examples](examples/)
### Basic features
We can start with a basic program that adds the numbers 3 and 2.
-
```py
-def main:
+def main... | [
"FEATURES.md"
] | [
{
"comment": "Can you add a comment somewhere near the beginning of this file saying that types are optional?",
"path": "FEATURES.md",
"hunk": "@@ -10,7 +10,7 @@ To see some more complex examples programs, check out the [examples](examples/)\n We can start with a basic program that adds the numbers 3 an... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | ```suggestion
def Pair/with_one(x: a) -> Pair(a, u24):
``` | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/FEATURES.md b/FEATURES.md
index 8f72a2bd..ce60841f 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -8,9 +8,8 @@ To see some more complex examples programs, check out the [examples](examples/)
### Basic features
We can start with a basic program that adds the numbers 3 and 2.
-
```py
-def main:
+def main... | [
"FEATURES.md"
] | [
{
"comment": "```suggestion\r\ndef Pair/with_one(x: a) -> Pair(a, u24):\r\n```",
"path": "FEATURES.md",
"hunk": "@@ -53,22 +53,22 @@ def tuple_fst(x):\n # With an object (similar to what other languages call a struct, a class or a record)\n object Pair { fst, snd }\n \n-def Pair/fst(x):\n+def Pair/fst(x... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | ```suggestion
def Pair/swap(x: Pair(a, b)) -> Pair(b, a):
``` | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/FEATURES.md b/FEATURES.md
index 8f72a2bd..ce60841f 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -8,9 +8,8 @@ To see some more complex examples programs, check out the [examples](examples/)
### Basic features
We can start with a basic program that adds the numbers 3 and 2.
-
```py
-def main:
+def main... | [
"FEATURES.md"
] | [
{
"comment": "```suggestion\r\ndef Pair/swap(x: Pair(a, b)) -> Pair(b, a):\r\n```",
"path": "FEATURES.md",
"hunk": "@@ -53,22 +53,22 @@ def tuple_fst(x):\n # With an object (similar to what other languages call a struct, a class or a record)\n object Pair { fst, snd }\n \n-def Pair/fst(x):\n+def Pair/fs... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | Would be interesting to remark somewhere around here that since MyTree has no type annotations, its fields will be considered of type Any which kind of partially disables the type checker for these values.
So in this case, the fact that `x` is holding a tree of u24 and not a tree of anything else won't be checked an... | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/FEATURES.md b/FEATURES.md
index 8f72a2bd..ce60841f 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -8,9 +8,8 @@ To see some more complex examples programs, check out the [examples](examples/)
### Basic features
We can start with a basic program that adds the numbers 3 and 2.
-
```py
-def main:
+def main... | [
"FEATURES.md"
] | [
{
"comment": "Would be interesting to remark somewhere around here that since MyTree has no type annotations, its fields will be considered of type Any which kind of partially disables the type checker for these values.\r\n\r\nSo in this case, the fact that `x` is holding a tree of u24 and not a tree of anythin... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | Annotating functions with `Any` is not useful for the guide. Either leave unnanotated or use something like the `_` type if you don't want to write the type in full (the type is not relevant to this example so it makes sense to not write it). | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/FEATURES.md b/FEATURES.md
index 8f72a2bd..ce60841f 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -8,9 +8,8 @@ To see some more complex examples programs, check out the [examples](examples/)
### Basic features
We can start with a basic program that adds the numbers 3 and 2.
-
```py
-def main:
+def main... | [
"FEATURES.md"
] | [
{
"comment": "Annotating functions with `Any` is not useful for the guide. Either leave unnanotated or use something like the `_` type if you don't want to write the type in full (the type is not relevant to this example so it makes sense to not write it).",
"path": "FEATURES.md",
"hunk": "@@ -201,21 +2... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | This function can't be typed with bend's type system. Don't add type annotations here or give them type Any and maybe write that as a comment. | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/FEATURES.md b/FEATURES.md
index 8f72a2bd..ce60841f 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -8,9 +8,8 @@ To see some more complex examples programs, check out the [examples](examples/)
### Basic features
We can start with a basic program that adds the numbers 3 and 2.
-
```py
-def main:
+def main... | [
"FEATURES.md"
] | [
{
"comment": "This function can't be typed with bend's type system. Don't add type annotations here or give them type Any and maybe write that as a comment.",
"path": "FEATURES.md",
"hunk": "@@ -227,15 +227,12 @@ If your recursive function is not based on pattern matching syntax (like `if`, `\n ```py\n ... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | Same thing here | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/FEATURES.md b/FEATURES.md
index 8f72a2bd..ce60841f 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -8,9 +8,8 @@ To see some more complex examples programs, check out the [examples](examples/)
### Basic features
We can start with a basic program that adds the numbers 3 and 2.
-
```py
-def main:
+def main... | [
"FEATURES.md"
] | [
{
"comment": "Same thing here",
"path": "FEATURES.md",
"hunk": "@@ -227,15 +227,12 @@ If your recursive function is not based on pattern matching syntax (like `if`, `\n ```py\n # A scott-encoded list folding function\n # Writing it like this will cause an infinite loop.\n-def scott_list.add(xs, add):\n-... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | Missing the type annotations for both string and list | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/FEATURES.md b/FEATURES.md
index 8f72a2bd..ce60841f 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -8,9 +8,8 @@ To see some more complex examples programs, check out the [examples](examples/)
### Basic features
We can start with a basic program that adds the numbers 3 and 2.
-
```py
-def main:
+def main... | [
"FEATURES.md"
] | [
{
"comment": "Missing the type annotations for both string and list",
"path": "FEATURES.md",
"hunk": "@@ -266,28 +263,35 @@ Floating point numbers must have the decimal point `.` and can optionally take a\n The three number types are fundamentally different.\n If you mix two numbers of different types H... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | Add type annotations for is_even | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/FEATURES.md b/FEATURES.md
index 8f72a2bd..ce60841f 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -8,9 +8,8 @@ To see some more complex examples programs, check out the [examples](examples/)
### Basic features
We can start with a basic program that adds the numbers 3 and 2.
-
```py
-def main:
+def main... | [
"FEATURES.md"
] | [
{
"comment": "Add type annotations for is_even",
"path": "FEATURES.md",
"hunk": "@@ -386,15 +381,15 @@ type Bool:\n True\n False\n \n-def is_odd(x):\n+def is_odd(x: u24) -> Bool:\n switch x:\n case 0:\n return Bool/False\n case _:\n return is_even(x-1)\n \n (is_even n) = switch... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | I think it's best if we explicitly write run-c here | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/GUIDE.md b/GUIDE.md
index ea89b25c..f048b9b4 100644
--- a/GUIDE.md
+++ b/GUIDE.md
@@ -78,19 +78,28 @@ and recursion play an important role. This is how its `"Hello, world!"` looks:
def main():
return "Hello, world!"
```
-
+To run the program above, type:
+```
+bend run-rs main.bend
+```
Wait - there ... | [
"GUIDE.md"
] | [
{
"comment": "I think it's best if we explicitly write run-c here",
"path": "GUIDE.md",
"hunk": "@@ -78,19 +78,28 @@ and recursion play an important role. This is how its `\"Hello, world!\"` looks:\n def main():\n return \"Hello, world!\"\n ```\n-\n+To run the program above, type:\n+```\n+bend run-rs ... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | ```suggestion
... because that would require mutating the `result` variable. Instead, we should write:
``` | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/GUIDE.md b/GUIDE.md
index ea89b25c..f048b9b4 100644
--- a/GUIDE.md
+++ b/GUIDE.md
@@ -78,19 +78,28 @@ and recursion play an important role. This is how its `"Hello, world!"` looks:
def main():
return "Hello, world!"
```
-
+To run the program above, type:
+```
+bend run-rs main.bend
+```
Wait - there ... | [
"GUIDE.md"
] | [
{
"comment": "```suggestion\r\n... because that would require mutating the `result` variable. Instead, we should write:\r\n```",
"path": "GUIDE.md",
"hunk": "@@ -299,13 +314,13 @@ def parity(x):\n ... because that would mutate the `result` variable. Instead, we should write:",
"resolving_sha": "4979... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | You forgot to remove this | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/GUIDE.md b/GUIDE.md
index ea89b25c..f048b9b4 100644
--- a/GUIDE.md
+++ b/GUIDE.md
@@ -78,19 +78,28 @@ and recursion play an important role. This is how its `"Hello, world!"` looks:
def main():
return "Hello, world!"
```
-
+To run the program above, type:
+```
+bend run-rs main.bend
+```
Wait - there ... | [
"GUIDE.md"
] | [
{
"comment": "You forgot to remove this",
"path": "GUIDE.md",
"hunk": "@@ -411,8 +426,9 @@ def enum(tree):\n return ![tree.left(idx * 2 + 0), tree.right(idx * 2 + 1)]\n case Tree/Leaf:\n return !(idx, tree.value)\n+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@VER PRA TIPAR ESSA FUNÇ... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | ```suggestion
def main() -> Tree(u24):
``` | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/GUIDE.md b/GUIDE.md
index ea89b25c..f048b9b4 100644
--- a/GUIDE.md
+++ b/GUIDE.md
@@ -78,19 +78,28 @@ and recursion play an important role. This is how its `"Hello, world!"` looks:
def main():
return "Hello, world!"
```
-
+To run the program above, type:
+```
+bend run-rs main.bend
+```
Wait - there ... | [
"GUIDE.md"
] | [
{
"comment": "```suggestion\r\ndef main() -> Tree(u24):\r\n```",
"path": "GUIDE.md",
"hunk": "@@ -411,8 +426,9 @@ def enum(tree):\n return ![tree.left(idx * 2 + 0), tree.right(idx * 2 + 1)]\n case Tree/Leaf:\n return !(idx, tree.value)\n+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | ```suggestion
def reverse(list: List(T)) -> List(T):
``` | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/GUIDE.md b/GUIDE.md
index ea89b25c..f048b9b4 100644
--- a/GUIDE.md
+++ b/GUIDE.md
@@ -78,19 +78,28 @@ and recursion play an important role. This is how its `"Hello, world!"` looks:
def main():
return "Hello, world!"
```
-
+To run the program above, type:
+```
+bend run-rs main.bend
+```
Wait - there ... | [
"GUIDE.md"
] | [
{
"comment": "```suggestion\r\ndef reverse(list: List(T)) -> List(T):\r\n```",
"path": "GUIDE.md",
"hunk": "@@ -434,11 +450,11 @@ it is really liberating, and will let you write better algorithms. As an\n exercise, use `fold` to implement a \"reverse\" algorithm for lists:\n \n ```python\n-def reverse(l... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | ```suggestion
def main() -> List(u24):
``` | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/GUIDE.md b/GUIDE.md
index ea89b25c..f048b9b4 100644
--- a/GUIDE.md
+++ b/GUIDE.md
@@ -78,19 +78,28 @@ and recursion play an important role. This is how its `"Hello, world!"` looks:
def main():
return "Hello, world!"
```
-
+To run the program above, type:
+```
+bend run-rs main.bend
+```
Wait - there ... | [
"GUIDE.md"
] | [
{
"comment": "```suggestion\r\ndef main() -> List(u24):\r\n```",
"path": "GUIDE.md",
"hunk": "@@ -434,11 +450,11 @@ it is really liberating, and will let you write better algorithms. As an\n exercise, use `fold` to implement a \"reverse\" algorithm for lists:\n \n ```python\n-def reverse(list):\n+def re... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | forgot to remove this comment | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/GUIDE.md b/GUIDE.md
index ea89b25c..f048b9b4 100644
--- a/GUIDE.md
+++ b/GUIDE.md
@@ -78,19 +78,28 @@ and recursion play an important role. This is how its `"Hello, world!"` looks:
def main():
return "Hello, world!"
```
-
+To run the program above, type:
+```
+bend run-rs main.bend
+```
Wait - there ... | [
"GUIDE.md"
] | [
{
"comment": "forgot to remove this comment",
"path": "GUIDE.md",
"hunk": "@@ -575,14 +591,15 @@ unlike the former one, they will run in parallel. And that's why `bend` and\n example, to add numbers in parallel, we can write:\n \n ```python\n-def main():\n+def main() -> u24:\n bend d = 0, i = 0:\n ... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | ```suggestion
> Note: The type of this function can't be expressed with Bend's type system, but we can still write it using `Any`.
``` | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/GUIDE.md b/GUIDE.md
index ea89b25c..f048b9b4 100644
--- a/GUIDE.md
+++ b/GUIDE.md
@@ -78,19 +78,28 @@ and recursion play an important role. This is how its `"Hello, world!"` looks:
def main():
return "Hello, world!"
```
-
+To run the program above, type:
+```
+bend run-rs main.bend
+```
Wait - there ... | [
"GUIDE.md"
] | [
{
"comment": "```suggestion\r\n> Note: The type of this function can't be expressed with Bend's type system, but we can still write it using `Any`.\r\n```",
"path": "GUIDE.md",
"hunk": "@@ -655,29 +672,32 @@ implemented as a series of _immutable tree rotations_, with pattern-matching and\n recursion. Do... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | You erased the return type | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/builtins.md b/docs/builtins.md
index ee6f4c17..4ab66dcc 100644
--- a/docs/builtins.md
+++ b/docs/builtins.md
@@ -7,7 +7,9 @@
## String
```python
-type String = (Cons head ~tail) | (Nil)
+type String:
+ Nil
+ Cons { head: u24, ~tail: String }
```
- **Nil**: Represents an empty string.
@@ -25,... | [
"docs/builtins.md"
] | [
{
"comment": "You erased the return type",
"path": "docs/builtins.md",
"hunk": "@@ -104,26 +117,34 @@ List/concat([1, 2], [4, 5])\n \n #### List/filter\n \n-Filters a list based on a predicate function.\n-\n ```python\n+#{\n+ Filters a list based on a predicate function.\n+#}\n List/filter(xs: List(T),... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | Duplicated comment | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/builtins.md b/docs/builtins.md
index ee6f4c17..4ab66dcc 100644
--- a/docs/builtins.md
+++ b/docs/builtins.md
@@ -7,7 +7,9 @@
## String
```python
-type String = (Cons head ~tail) | (Nil)
+type String:
+ Nil
+ Cons { head: u24, ~tail: String }
```
- **Nil**: Represents an empty string.
@@ -25,... | [
"docs/builtins.md"
] | [
{
"comment": "Duplicated comment",
"path": "docs/builtins.md",
"hunk": "@@ -178,14 +205,12 @@ maybe = Maybe/Some(Nat/Succ(Nat/Zero))\n ## Maybe functions\n \n ### Maybe/unwrap\n-Maybe has a builtin function that returns the value inside the `Maybe` if it is `Some`, and returns `unreachable()` if it is `... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | Should mention that it returns `unreachable` if we try to get a key not in the map. The logic for checking if the value is present or not should be done outside of this function. | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/builtins.md b/docs/builtins.md
index ee6f4c17..4ab66dcc 100644
--- a/docs/builtins.md
+++ b/docs/builtins.md
@@ -7,7 +7,9 @@
## String
```python
-type String = (Cons head ~tail) | (Nil)
+type String:
+ Nil
+ Cons { head: u24, ~tail: String }
```
- **Nil**: Represents an empty string.
@@ -25,... | [
"docs/builtins.md"
] | [
{
"comment": "Should mention that it returns `unreachable` if we try to get a key not in the map. The logic for checking if the value is present or not should be done outside of this function.",
"path": "docs/builtins.md",
"hunk": "@@ -229,31 +255,22 @@ Here, `map` must be the name of the `Map` variable... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | 0 and 1 are always u24 numbers | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/builtins.md b/docs/builtins.md
index ee6f4c17..4ab66dcc 100644
--- a/docs/builtins.md
+++ b/docs/builtins.md
@@ -7,7 +7,9 @@
## String
```python
-type String = (Cons head ~tail) | (Nil)
+type String:
+ Nil
+ Cons { head: u24, ~tail: String }
```
- **Nil**: Represents an empty string.
@@ -25,... | [
"docs/builtins.md"
] | [
{
"comment": "0 and 1 are always u24 numbers",
"path": "docs/builtins.md",
"hunk": "@@ -359,26 +355,12 @@ x[0] @= lambda y: String/concat(y, \" and mapped\")\n \n \n ### Map/contains\n-Checks if a `map` contains a given `key` and returns 0 or 1 as a `u24` number and the `map` unchanged.\n-```python\n-de... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | These things should be part of the doc comment | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/builtins.md b/docs/builtins.md
index ee6f4c17..4ab66dcc 100644
--- a/docs/builtins.md
+++ b/docs/builtins.md
@@ -7,7 +7,9 @@
## String
```python
-type String = (Cons head ~tail) | (Nil)
+type String:
+ Nil
+ Cons { head: u24, ~tail: String }
```
- **Nil**: Represents an empty string.
@@ -25,... | [
"docs/builtins.md"
] | [
{
"comment": "These things should be part of the doc comment",
"path": "docs/builtins.md",
"hunk": "@@ -591,23 +590,23 @@ You can read more on how to implement these libraries in the [Dynamically linked\n #### IO/DyLib/open\n \n ```py\n-def IO/DyLib/open(path: String, lazy: u24) -> u24\n+#{\n+ Loads a ... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | It's not relevant to users that these functions are implemented using hvm native code. You can just write their signatures here as if they were regular functions. | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/builtins.md b/docs/builtins.md
index ee6f4c17..4ab66dcc 100644
--- a/docs/builtins.md
+++ b/docs/builtins.md
@@ -7,7 +7,9 @@
## String
```python
-type String = (Cons head ~tail) | (Nil)
+type String:
+ Nil
+ Cons { head: u24, ~tail: String }
```
- **Nil**: Represents an empty string.
@@ -25,... | [
"docs/builtins.md"
] | [
{
"comment": "It's not relevant to users that these functions are implemented using hvm native code. You can just write their signatures here as if they were regular functions.",
"path": "docs/builtins.md",
"hunk": "@@ -629,220 +628,293 @@ Closes a previously open library.\n ### to_f24\n \n ```py\n-def ... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | You don't need to put the implementation of the math functions here, it's not important. | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/builtins.md b/docs/builtins.md
index ee6f4c17..4ab66dcc 100644
--- a/docs/builtins.md
+++ b/docs/builtins.md
@@ -7,7 +7,9 @@
## String
```python
-type String = (Cons head ~tail) | (Nil)
+type String:
+ Nil
+ Cons { head: u24, ~tail: String }
```
- **Nil**: Represents an empty string.
@@ -25,... | [
"docs/builtins.md"
] | [
{
"comment": "You don't need to put the implementation of the math functions here, it's not important.",
"path": "docs/builtins.md",
"hunk": "@@ -629,220 +628,293 @@ Closes a previously open library.\n ### to_f24\n \n ```py\n-def to_f24(x: any number) -> f24\n-```\n-\n-Casts any native number to an f24.... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | These are not bend commands, they're sh commands, you can't just use bend syntax for multiline comments here | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/cli-arguments.md b/docs/cli-arguments.md
index c72f64e2..a6a58798 100644
--- a/docs/cli-arguments.md
+++ b/docs/cli-arguments.md
@@ -34,8 +34,7 @@ def main(x, y):
# Calling with two argument
> bend run <path> +5 +3
{+2 -2}
-
-# Calling with three argument
+# Calling with three arguments
# In this ... | [
"docs/cli-arguments.md"
] | [
{
"comment": "These are not bend commands, they're sh commands, you can't just use bend syntax for multiline comments here",
"path": "docs/cli-arguments.md",
"hunk": "@@ -35,11 +35,13 @@ def main(x, y):\n > bend run <path> +5 +3\n {+2 -2}\n \n-# Calling with three argument\n-# In this case, the third ar... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | Follow the template for the other options. | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/compiler-options.md b/docs/compiler-options.md
index 71d817b6..2c4b42c7 100644
--- a/docs/compiler-options.md
+++ b/docs/compiler-options.md
@@ -12,7 +12,7 @@
| `-Oinline` `-Ono-inline` | Disabled | [inline](#inline) |
| `-... | [
"docs/compiler-options.md"
] | [
{
"comment": "Follow the template for the other options.",
"path": "docs/compiler-options.md",
"hunk": "@@ -12,6 +12,7 @@\n | `-Oinline` `-Ono-inline` | Disabled | [inline](#inline) |\n | `-Ocheck-net-size` `-Ono-check-net-size... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | It doesn't check that types are declared correctly, that's not what type checking does. https://en.wikipedia.org/wiki/Type_system#Type_checking | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/compiler-options.md b/docs/compiler-options.md
index 71d817b6..2c4b42c7 100644
--- a/docs/compiler-options.md
+++ b/docs/compiler-options.md
@@ -12,7 +12,7 @@
| `-Oinline` `-Ono-inline` | Disabled | [inline](#inline) |
| `-... | [
"docs/compiler-options.md"
] | [
{
"comment": "It doesn't check that types are declared correctly, that's not what type checking does. https://en.wikipedia.org/wiki/Type_system#Type_checking",
"path": "docs/compiler-options.md",
"hunk": "@@ -259,3 +260,13 @@ Option/None/tag = 1\n Pattern-matching with `match` and `fold` is generated ac... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | These are not doc comments, they're comments explaining the examples. We shouldn't use multiline comments here | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/defining-data-types.md b/docs/defining-data-types.md
index c2bce26f..2fb0109f 100644
--- a/docs/defining-data-types.md
+++ b/docs/defining-data-types.md
@@ -3,31 +3,41 @@
It is possible to easily define complex data types using the `type` keyword.
```py
-# A Boolean is either True or False
-type B... | [
"docs/defining-data-types.md"
] | [
{
"comment": "These are not doc comments, they're comments explaining the examples. We shouldn't use multiline comments here",
"path": "docs/defining-data-types.md",
"hunk": "@@ -3,48 +3,64 @@\n It is possible to easily define complex data types using the `type` keyword.\n \n ```py\n-# A Boolean is eith... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | Instead of removing this part, you can change it to say that it can be destructured using `open` | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/defining-data-types.md b/docs/defining-data-types.md
index c2bce26f..2fb0109f 100644
--- a/docs/defining-data-types.md
+++ b/docs/defining-data-types.md
@@ -3,31 +3,41 @@
It is possible to easily define complex data types using the `type` keyword.
```py
-# A Boolean is either True or False
-type B... | [
"docs/defining-data-types.md"
] | [
{
"comment": "Instead of removing this part, you can change it to say that it can be destructured using `open`",
"path": "docs/defining-data-types.md",
"hunk": "@@ -3,48 +3,64 @@\n It is possible to easily define complex data types using the `type` keyword.\n \n ```py\n-# A Boolean is either True or Fal... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | The point of this section is showing pattern matching functions, you can't just change to the other syntax | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/defining-data-types.md b/docs/defining-data-types.md
index c2bce26f..2fb0109f 100644
--- a/docs/defining-data-types.md
+++ b/docs/defining-data-types.md
@@ -3,31 +3,41 @@
It is possible to easily define complex data types using the `type` keyword.
```py
-# A Boolean is either True or False
-type B... | [
"docs/defining-data-types.md"
] | [
{
"comment": "The point of this section is showing pattern matching functions, you can't just change to the other syntax",
"path": "docs/defining-data-types.md",
"hunk": "@@ -3,48 +3,64 @@\n It is possible to easily define complex data types using the `type` keyword.\n \n ```py\n-# A Boolean is either T... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | Same thing here | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/defining-data-types.md b/docs/defining-data-types.md
index c2bce26f..2fb0109f 100644
--- a/docs/defining-data-types.md
+++ b/docs/defining-data-types.md
@@ -3,31 +3,41 @@
It is possible to easily define complex data types using the `type` keyword.
```py
-# A Boolean is either True or False
-type B... | [
"docs/defining-data-types.md"
] | [
{
"comment": "Same thing here",
"path": "docs/defining-data-types.md",
"hunk": "@@ -3,48 +3,64 @@\n It is possible to easily define complex data types using the `type` keyword.\n \n ```py\n-# A Boolean is either True or False\n-type Bool = True | False\n+#{\n+ A Boolean is either True or False \n+}#\n+... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | remove the comments | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/ffi.md b/docs/ffi.md
index 0c770b6a..e69e4b14 100644
--- a/docs/ffi.md
+++ b/docs/ffi.md
@@ -27,8 +27,9 @@ def main():
# In our example, 'ls' receives a path as a String and
# returns a String with the result of the 'ls' command.
- files_bytes <- IO/DyLib/call(dl, "ls", "./")
- files... | [
"docs/ffi.md"
] | [
{
"comment": "remove the comments",
"path": "docs/ffi.md",
"hunk": "@@ -13,7 +13,7 @@ def main():\n # The second argument is '0' if we want to load all functions immediately.\n # Otherwise it should be '1' when we want to load functions as we use them.\n # 'dl' is the unique id of the dynami... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | instead of unwrapping at every use, just save the unwrapped dl variable. | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/ffi.md b/docs/ffi.md
index 0c770b6a..e69e4b14 100644
--- a/docs/ffi.md
+++ b/docs/ffi.md
@@ -27,8 +27,9 @@ def main():
# In our example, 'ls' receives a path as a String and
# returns a String with the result of the 'ls' command.
- files_bytes <- IO/DyLib/call(dl, "ls", "./")
- files... | [
"docs/ffi.md"
] | [
{
"comment": "instead of unwrapping at every use, just save the unwrapped dl variable.",
"path": "docs/ffi.md",
"hunk": "@@ -27,8 +27,8 @@ def main():\n \n # In our example, 'ls' receives a path as a String and\n # returns a String with the result of the 'ls' command.\n- files_bytes <- IO/Dy... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | This is not true (although its the recommended style) | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/imports.md b/docs/imports.md
index ada25cd6..d3a849bb 100644
--- a/docs/imports.md
+++ b/docs/imports.md
@@ -10,6 +10,7 @@ Imports can be declared two ways:
from path import name
# or
import path/name
+# We recommend always placing the imports at the top of the file.
```
## Project Structure
| [
"docs/imports.md"
] | [
{
"comment": "This is not true (although its the recommended style)",
"path": "docs/imports.md",
"hunk": "@@ -11,6 +11,8 @@ from path import name\n # or\n import path/name\n ```\n+## Placement\n+Imports should be placed at the top of a file.",
"resolving_sha": "4979b1413f3f7afcafe62c2d8a8203c351d561... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | ```suggestion
This is a simple piece of code that works on many other functional programming languages but hangs on Bend due to the strict evaluation of HVM2.
``` | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/lazy-definitions.md b/docs/lazy-definitions.md
index 1a9a8383..db491d14 100644
--- a/docs/lazy-definitions.md
+++ b/docs/lazy-definitions.md
@@ -2,7 +2,7 @@
In strict-mode, some types of recursive terms will unroll indefinitely.
-This is a simple piece of code that works on many other functional ... | [
"docs/lazy-definitions.md"
] | [
{
"comment": "```suggestion\r\nThis is a simple piece of code that works on many other functional programming languages but hangs on Bend due to the strict evaluation of HVM2.\r\n```",
"path": "docs/lazy-definitions.md",
"hunk": "@@ -2,7 +2,7 @@\n \n In strict-mode, some types of recursive terms will un... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | It does get reduced, it never reaches normal form / finishes reducing. | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/lazy-definitions.md b/docs/lazy-definitions.md
index 1a9a8383..db491d14 100644
--- a/docs/lazy-definitions.md
+++ b/docs/lazy-definitions.md
@@ -2,7 +2,7 @@
In strict-mode, some types of recursive terms will unroll indefinitely.
-This is a simple piece of code that works on many other functional ... | [
"docs/lazy-definitions.md"
] | [
{
"comment": "It does get reduced, it never reaches normal form / finishes reducing.",
"path": "docs/lazy-definitions.md",
"hunk": "@@ -16,20 +16,7 @@ Map = λf λlist\n Main = (Map λx (+ x 1) (Cons 1 Nil))\n ```\n \n-The recursive `Map` definition never gets reduced.\n-Using the debug mode `-d` we can se... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | `recursive calls should be wrapped in top-level combinators`
I don't understand what you meant by this.
The exact way that this works is a bit hard to put in words. The recursive part of the function should be part of a combinator that is not in an active position. That way it can be lifted into a top-level functio... | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/lazy-definitions.md b/docs/lazy-definitions.md
index 1a9a8383..db491d14 100644
--- a/docs/lazy-definitions.md
+++ b/docs/lazy-definitions.md
@@ -2,7 +2,7 @@
In strict-mode, some types of recursive terms will unroll indefinitely.
-This is a simple piece of code that works on many other functional ... | [
"docs/lazy-definitions.md"
] | [
{
"comment": "`recursive calls should be wrapped in top-level combinators`\r\nI don't understand what you meant by this.\r\n\r\nThe exact way that this works is a bit hard to put in words. The recursive part of the function should be part of a combinator that is not in an active position. That way it can be lif... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | Don't say "we recently introduced" since this document will someday get old. Also separate that into a different section/paragraph | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/native-numbers.md b/docs/native-numbers.md
index 8bdc95e2..7838816b 100644
--- a/docs/native-numbers.md
+++ b/docs/native-numbers.md
@@ -49,14 +49,24 @@ minus_zero = -0.0
### Mixing number types
-The three number types are fundamentally different.
-If you mix two numbers of different types, HVM w... | [
"docs/native-numbers.md"
] | [
{
"comment": "Don't say \"we recently introduced\" since this document will someday get old. Also separate that into a different section/paragraph",
"path": "docs/native-numbers.md",
"hunk": "@@ -50,13 +50,22 @@ minus_zero = -0.0\n ### Mixing number types\n \n The three number types are fundamentally di... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | Remove the type annotations here since they're only noise.
We should probably also add a note here that as a user you can't write a function with `__` in its name, that sequence is reserved for things generated by the compiler. | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/pattern-matching.md b/docs/pattern-matching.md
index 69068e17..148ed206 100644
--- a/docs/pattern-matching.md
+++ b/docs/pattern-matching.md
@@ -27,21 +27,21 @@ Matches on ADT constructors are compiled to different expressions depending on t
type Maybe = (Some val) | None
UnwrapOrZero x = match x ... | [
"docs/pattern-matching.md"
] | [
{
"comment": "Remove the type annotations here since they're only noise.\r\n\r\nWe should probably also add a note here that as a user you can't write a function with `__` in its name, that sequence is reserved for things generated by the compiler.",
"path": "docs/pattern-matching.md",
"hunk": "@@ -88,2... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | Please keep the grouping of the functions since it had a meaning. Also please align the comments. | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/pattern-matching.md b/docs/pattern-matching.md
index 69068e17..148ed206 100644
--- a/docs/pattern-matching.md
+++ b/docs/pattern-matching.md
@@ -27,21 +27,21 @@ Matches on ADT constructors are compiled to different expressions depending on t
type Maybe = (Some val) | None
UnwrapOrZero x = match x ... | [
"docs/pattern-matching.md"
] | [
{
"comment": "Please keep the grouping of the functions since it had a meaning. Also please align the comments.",
"path": "docs/pattern-matching.md",
"hunk": "@@ -88,28 +88,37 @@ To ensure that recursive pattern matching functions don't loop in strict mode, i\n ```py\n # This is what the Foo function ac... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | The second sentence, is not really relevant to what we're trying to show here. Also you're just describing what a tokenizer does. | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/pattern-matching.md b/docs/pattern-matching.md
index 69068e17..148ed206 100644
--- a/docs/pattern-matching.md
+++ b/docs/pattern-matching.md
@@ -27,21 +27,21 @@ Matches on ADT constructors are compiled to different expressions depending on t
type Maybe = (Some val) | None
UnwrapOrZero x = match x ... | [
"docs/pattern-matching.md"
] | [
{
"comment": "The second sentence, is not really relevant to what we're trying to show here. Also you're just describing what a tokenizer does.",
"path": "docs/pattern-matching.md",
"hunk": "@@ -88,28 +88,37 @@ To ensure that recursive pattern matching functions don't loop in strict mode, i\n ```py\n # ... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | This is harder to understand than the older version | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/pattern-matching.md b/docs/pattern-matching.md
index 69068e17..148ed206 100644
--- a/docs/pattern-matching.md
+++ b/docs/pattern-matching.md
@@ -27,21 +27,21 @@ Matches on ADT constructors are compiled to different expressions depending on t
type Maybe = (Some val) | None
UnwrapOrZero x = match x ... | [
"docs/pattern-matching.md"
] | [
{
"comment": "This is harder to understand than the older version",
"path": "docs/pattern-matching.md",
"hunk": "@@ -123,18 +132,19 @@ Parse = λarg0 switch matched = (- arg0 '(') {\n }\n }\n ```\n-Unlike with `switch`, with pattern matching equations you can't access the value of the predecessor of th... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | Cons and Nil | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/pattern-matching.md b/docs/pattern-matching.md
index 69068e17..148ed206 100644
--- a/docs/pattern-matching.md
+++ b/docs/pattern-matching.md
@@ -27,21 +27,21 @@ Matches on ADT constructors are compiled to different expressions depending on t
type Maybe = (Some val) | None
UnwrapOrZero x = match x ... | [
"docs/pattern-matching.md"
] | [
{
"comment": "Cons and Nil",
"path": "docs/pattern-matching.md",
"hunk": "@@ -123,18 +132,19 @@ Parse = λarg0 switch matched = (- arg0 '(') {\n }\n }\n ```\n-Unlike with `switch`, with pattern matching equations you can't access the value of the predecessor of the matched value directly, but instead y... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | Maybe you should instead say something like "patterns are considered from top to bottom". Also, i think it would fit better in the same paragraph as the sentence above | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/pattern-matching.md b/docs/pattern-matching.md
index 69068e17..148ed206 100644
--- a/docs/pattern-matching.md
+++ b/docs/pattern-matching.md
@@ -27,21 +27,21 @@ Matches on ADT constructors are compiled to different expressions depending on t
type Maybe = (Some val) | None
UnwrapOrZero x = match x ... | [
"docs/pattern-matching.md"
] | [
{
"comment": "Maybe you should instead say something like \"patterns are considered from top to bottom\". Also, i think it would fit better in the same paragraph as the sentence above",
"path": "docs/pattern-matching.md",
"hunk": "@@ -123,18 +132,19 @@ Parse = λarg0 switch matched = (- arg0 '(') {\n }... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | This type is not correct. `a` and `b` can't be any type, they must be native numbers. We can't currently express that with bend's syntax, you can just leave it untyped since it's not relevant to the example | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/syntax.md b/docs/syntax.md
index 76e80c8e..299741f6 100644
--- a/docs/syntax.md
+++ b/docs/syntax.md
@@ -55,7 +55,7 @@ def add(x: u24, y: u24) -> u24:
def unchecked two() -> u24:
return 2
-def main:
+def main() -> u24:
return add(40, two)
```
@@ -307,7 +307,7 @@ For fields notated with `~`... | [
"docs/syntax.md"
] | [
{
"comment": "This type is not correct. `a` and `b` can't be any type, they must be native numbers. We can't currently express that with bend's syntax, you can just leave it untyped since it's not relevant to the example",
"path": "docs/syntax.md",
"hunk": "@@ -187,7 +187,7 @@ Returns the expression tha... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | same thing here | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/syntax.md b/docs/syntax.md
index 76e80c8e..299741f6 100644
--- a/docs/syntax.md
+++ b/docs/syntax.md
@@ -55,7 +55,7 @@ def add(x: u24, y: u24) -> u24:
def unchecked two() -> u24:
return 2
-def main:
+def main() -> u24:
return add(40, two)
```
@@ -307,7 +307,7 @@ For fields notated with `~`... | [
"docs/syntax.md"
] | [
{
"comment": "same thing here",
"path": "docs/syntax.md",
"hunk": "@@ -207,7 +207,7 @@ def Foo(x):\n \n ```py\n # Not allowed, one of the branches doesn't return\n-def Foo(a, b):\n+def Foo(a: T, b: T) -> T:",
"resolving_sha": "4979b1413f3f7afcafe62c2d8a8203c351d5611a",
"resolving_diff": "diff --... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | ```suggestion
def fold(x: Tree(u24)) -> u24:
``` | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/syntax.md b/docs/syntax.md
index 76e80c8e..299741f6 100644
--- a/docs/syntax.md
+++ b/docs/syntax.md
@@ -55,7 +55,7 @@ def add(x: u24, y: u24) -> u24:
def unchecked two() -> u24:
return 2
-def main:
+def main() -> u24:
return add(40, two)
```
@@ -307,7 +307,7 @@ For fields notated with `~`... | [
"docs/syntax.md"
] | [
{
"comment": "```suggestion\r\ndef fold(x: Tree(u24)) -> u24:\r\n```",
"path": "docs/syntax.md",
"hunk": "@@ -307,7 +307,7 @@ For fields notated with `~` in the type definition, the fold function is called\n It is equivalent to the inline recursive function:\n \n ```python\n-def fold(x):\n+def fold(x: T... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | We can't write operations that mix two types of number but we can explicitly convert between them | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/syntax.md b/docs/syntax.md
index 76e80c8e..299741f6 100644
--- a/docs/syntax.md
+++ b/docs/syntax.md
@@ -55,7 +55,7 @@ def add(x: u24, y: u24) -> u24:
def unchecked two() -> u24:
return 2
-def main:
+def main() -> u24:
return add(40, two)
```
@@ -307,7 +307,7 @@ For fields notated with `~`... | [
"docs/syntax.md"
] | [
{
"comment": "We can't write operations that mix two types of number but we can explicitly convert between them",
"path": "docs/syntax.md",
"hunk": "@@ -581,7 +581,7 @@ i24 = -42\n u24 = 42\n ```\n \n-Currently, the 3 number types cannot be mixed.\n+Currently, the 3 number types cannot be mixed, but can... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | ```suggestion
def second(x: A, y: B) -> B:
``` | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/syntax.md b/docs/syntax.md
index 76e80c8e..299741f6 100644
--- a/docs/syntax.md
+++ b/docs/syntax.md
@@ -55,7 +55,7 @@ def add(x: u24, y: u24) -> u24:
def unchecked two() -> u24:
return 2
-def main:
+def main() -> u24:
return add(40, two)
```
@@ -307,7 +307,7 @@ For fields notated with `~`... | [
"docs/syntax.md"
] | [
{
"comment": "```suggestion\r\ndef second(x: A, y: B) -> B:\r\n```",
"path": "docs/syntax.md",
"hunk": "@@ -1350,14 +1350,14 @@ def main():\n Use `#{ ... #}` to indicate a multi-line comment.\n \n Multi-line commenting should also be used to document code.\n-\n+Documentation for functions is meant to be... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | This is too complicated for first example. Let's try breaking into 2 pieces, one just like the old one and then another showing optional typing. | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/FEATURES.md b/FEATURES.md
index 8f72a2bd..ce60841f 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -8,9 +8,8 @@ To see some more complex examples programs, check out the [examples](examples/)
### Basic features
We can start with a basic program that adds the numbers 3 and 2.
-
```py
-def main:
+def main... | [
"FEATURES.md"
] | [
{
"comment": "This is too complicated for first example. Let's try breaking into 2 pieces, one just like the old one and then another showing optional typing.",
"path": "FEATURES.md",
"hunk": "@@ -6,11 +6,10 @@ You can read the full reference for both of them [here](docs/syntax.md), but the\n To see som... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | ```suggestion
> Note: since MyTree has no type annotations, its fields will be considered of type `Any`, which partially disables the type checker for these values. Thus the fact that `x` is holding a tree of u24 and not a tree of anything else won't be checked and it's up to the user to make sure it's correct.
``` | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/FEATURES.md b/FEATURES.md
index 8f72a2bd..ce60841f 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -8,9 +8,8 @@ To see some more complex examples programs, check out the [examples](examples/)
### Basic features
We can start with a basic program that adds the numbers 3 and 2.
-
```py
-def main:
+def main... | [
"FEATURES.md"
] | [
{
"comment": "```suggestion\r\n> Note: since MyTree has no type annotations, its fields will be considered of type `Any`, which partially disables the type checker for these values. Thus the fact that `x` is holding a tree of u24 and not a tree of anything else won't be checked and it's up to the user to make s... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | This is strangely worded and doesn't fir the rest of the file.
Something like "You can convert between the number types using the builtin casting functions" would be better i think | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/FEATURES.md b/FEATURES.md
index 8f72a2bd..ce60841f 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -8,9 +8,8 @@ To see some more complex examples programs, check out the [examples](examples/)
### Basic features
We can start with a basic program that adds the numbers 3 and 2.
-
```py
-def main:
+def main... | [
"FEATURES.md"
] | [
{
"comment": "This is strangely worded and doesn't fir the rest of the file.\r\nSomething like \"You can convert between the number types using the builtin casting functions\" would be better i think",
"path": "FEATURES.md",
"hunk": "@@ -266,28 +267,35 @@ Floating point numbers must have the decimal poi... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | Don't remove this, it's important. | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/FEATURES.md b/FEATURES.md
index 8f72a2bd..ce60841f 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -8,9 +8,8 @@ To see some more complex examples programs, check out the [examples](examples/)
### Basic features
We can start with a basic program that adds the numbers 3 and 2.
-
```py
-def main:
+def main... | [
"FEATURES.md"
] | [
{
"comment": "Don't remove this, it's important.",
"path": "FEATURES.md",
"hunk": "@@ -266,28 +267,35 @@ Floating point numbers must have the decimal point `.` and can optionally take a\n The three number types are fundamentally different.\n If you mix two numbers of different types HVM will interpret t... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | `#` means a BIG header, better to write something like "Bend has Lists and Strings, ... This is how they're defined." | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/FEATURES.md b/FEATURES.md
index 8f72a2bd..ce60841f 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -8,9 +8,8 @@ To see some more complex examples programs, check out the [examples](examples/)
### Basic features
We can start with a basic program that adds the numbers 3 and 2.
-
```py
-def main:
+def main... | [
"FEATURES.md"
] | [
{
"comment": "`#` means a BIG header, better to write something like \"Bend has Lists and Strings, ... This is how they're defined.\"",
"path": "FEATURES.md",
"hunk": "@@ -266,28 +267,35 @@ Floating point numbers must have the decimal point `.` and can optionally take a\n The three number types are fund... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | Keep the `\`blue\`` key, it's meant to show the symbol syntax sugar (numeric value for small strings), just change the value to also be a string. | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/FEATURES.md b/FEATURES.md
index 8f72a2bd..ce60841f 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -8,9 +8,8 @@ To see some more complex examples programs, check out the [examples](examples/)
### Basic features
We can start with a basic program that adds the numbers 3 and 2.
-
```py
-def main:
+def main... | [
"FEATURES.md"
] | [
{
"comment": "Keep the `\\`blue\\`` key, it's meant to show the symbol syntax sugar (numeric value for small strings), just change the value to also be a string.",
"path": "FEATURES.md",
"hunk": "@@ -339,38 +339,37 @@ A Map is desugared to a Map data type containing two constructors `Map/Leaf` and\n \n ... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | ```suggestion
left: Tree/Node{left: Tree/Leaf {value: 1}, right: Tree/Leaf {value: 2}},
``` | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/GUIDE.md b/GUIDE.md
index ea89b25c..f048b9b4 100644
--- a/GUIDE.md
+++ b/GUIDE.md
@@ -78,19 +78,28 @@ and recursion play an important role. This is how its `"Hello, world!"` looks:
def main():
return "Hello, world!"
```
-
+To run the program above, type:
+```
+bend run-rs main.bend
+```
Wait - there ... | [
"GUIDE.md"
] | [
{
"comment": "```suggestion\r\n left: Tree/Node{left: Tree/Leaf {value: 1}, right: Tree/Leaf {value: 2}},\r\n```",
"path": "GUIDE.md",
"hunk": "@@ -352,9 +367,9 @@ _recursive_. For example, the tree:\n Could be represented as:\n \n ```\n-tree = Tree/Node {\n- lft: Tree/Node { left: Tree/Leaf { val: 1... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | ```suggestion
{+2 -2}
``` | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/cli-arguments.md b/docs/cli-arguments.md
index c72f64e2..a6a58798 100644
--- a/docs/cli-arguments.md
+++ b/docs/cli-arguments.md
@@ -34,8 +34,7 @@ def main(x, y):
# Calling with two argument
> bend run <path> +5 +3
{+2 -2}
-
-# Calling with three argument
+# Calling with three arguments
# In this ... | [
"docs/cli-arguments.md"
] | [
{
"comment": "```suggestion\r\n{+2 -2}\r\n```",
"path": "docs/cli-arguments.md",
"hunk": "@@ -33,13 +33,14 @@ def main(x, y):\n \n # Calling with two argument\n > bend run <path> +5 +3\n-{+2 -2}\n-\n-# Calling with three argument\n+{+2 -2}#",
"resolving_sha": "4979b1413f3f7afcafe62c2d8a8203c351d5611... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | Again, saying "we introduced" will not age well. Instead, just "There is a way" | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/native-numbers.md b/docs/native-numbers.md
index 8bdc95e2..7838816b 100644
--- a/docs/native-numbers.md
+++ b/docs/native-numbers.md
@@ -49,14 +49,24 @@ minus_zero = -0.0
### Mixing number types
-The three number types are fundamentally different.
-If you mix two numbers of different types, HVM w... | [
"docs/native-numbers.md"
] | [
{
"comment": "Again, saying \"we introduced\" will not age well. Instead, just \"There is a way\"",
"path": "docs/native-numbers.md",
"hunk": "@@ -50,13 +50,26 @@ minus_zero = -0.0\n ### Mixing number types\n \n The three number types are fundamentally different.\n-If you mix two numbers of different ty... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | You're missing the `Foo` function. Without that I actually can't check if the comments on the right are correct or not (since we don't know the order they're being called. | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/pattern-matching.md b/docs/pattern-matching.md
index 69068e17..148ed206 100644
--- a/docs/pattern-matching.md
+++ b/docs/pattern-matching.md
@@ -27,21 +27,21 @@ Matches on ADT constructors are compiled to different expressions depending on t
type Maybe = (Some val) | None
UnwrapOrZero x = match x ... | [
"docs/pattern-matching.md"
] | [
{
"comment": "You're missing the `Foo` function. Without that I actually can't check if the comments on the right are correct or not (since we don't know the order they're being called.",
"path": "docs/pattern-matching.md",
"hunk": "@@ -88,18 +88,19 @@ To ensure that recursive pattern matching functions... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | Instead of calling the inner functions `A` and `B`, could you name them some slightly larger dummy name. Like `Bar` `Baz`, etc, just to make iit a bit more readable | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/pattern-matching.md b/docs/pattern-matching.md
index 69068e17..148ed206 100644
--- a/docs/pattern-matching.md
+++ b/docs/pattern-matching.md
@@ -27,21 +27,21 @@ Matches on ADT constructors are compiled to different expressions depending on t
type Maybe = (Some val) | None
UnwrapOrZero x = match x ... | [
"docs/pattern-matching.md"
] | [
{
"comment": "Instead of calling the inner functions `A` and `B`, could you name them some slightly larger dummy name. Like `Bar` `Baz`, etc, just to make iit a bit more readable",
"path": "docs/pattern-matching.md",
"hunk": "@@ -88,18 +88,19 @@ To ensure that recursive pattern matching functions don't ... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | ```suggestion
Retrieves a `value` from the `map` based on the `key` and returns a tuple with the value and the `map` unchanged.
The logic for checking whether a value is or not contained in a `map` is not done in the `get` function, so if we try to get a key that is not in the map, the program will return `un... | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/builtins.md b/docs/builtins.md
index ee6f4c17..4ab66dcc 100644
--- a/docs/builtins.md
+++ b/docs/builtins.md
@@ -7,7 +7,9 @@
## String
```python
-type String = (Cons head ~tail) | (Nil)
+type String:
+ Nil
+ Cons { head: u24, ~tail: String }
```
- **Nil**: Represents an empty string.
@@ -25,... | [
"docs/builtins.md"
] | [
{
"comment": "```suggestion\r\n Retrieves a `value` from the `map` based on the `key` and returns a tuple with the value and the `map` unchanged.\r\n \r\n The logic for checking whether a value is or not contained in a `map` is not done in the `get` function, so if we try to get a key that is not in the map,... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | This should have the type signature and not the implementation | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/builtins.md b/docs/builtins.md
index ee6f4c17..4ab66dcc 100644
--- a/docs/builtins.md
+++ b/docs/builtins.md
@@ -7,7 +7,9 @@
## String
```python
-type String = (Cons head ~tail) | (Nil)
+type String:
+ Nil
+ Cons { head: u24, ~tail: String }
```
- **Nil**: Represents an empty string.
@@ -25,... | [
"docs/builtins.md"
] | [
{
"comment": "This should have the type signature and not the implementation",
"path": "docs/builtins.md",
"hunk": "@@ -229,31 +254,22 @@ Here, `map` must be the name of the `Map` variable, and the keys inside `[]` can\n \n ### Map/empty\n \n-Initializes an empty map.\n-\n ```python\n+#{\n+ Initializes... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | This is not what the type checker does. Also, please do like the others and point to the section | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/compiler-options.md b/docs/compiler-options.md
index 71d817b6..2c4b42c7 100644
--- a/docs/compiler-options.md
+++ b/docs/compiler-options.md
@@ -12,7 +12,7 @@
| `-Oinline` `-Ono-inline` | Disabled | [inline](#inline) |
| `-... | [
"docs/compiler-options.md"
] | [
{
"comment": "This is not what the type checker does. Also, please do like the others and point to the section",
"path": "docs/compiler-options.md",
"hunk": "@@ -12,6 +12,7 @@\n | `-Oinline` `-Ono-inline` | Disabled | [inline](#inline) ... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | This is not typed correctly, please test the function. | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/ffi.md b/docs/ffi.md
index 0c770b6a..e69e4b14 100644
--- a/docs/ffi.md
+++ b/docs/ffi.md
@@ -27,8 +27,9 @@ def main():
# In our example, 'ls' receives a path as a String and
# returns a String with the result of the 'ls' command.
- files_bytes <- IO/DyLib/call(dl, "ls", "./")
- files... | [
"docs/ffi.md"
] | [
{
"comment": "This is not typed correctly, please test the function.",
"path": "docs/ffi.md",
"hunk": "@@ -13,7 +13,7 @@ def main():\n # The second argument is '0' if we want to load all functions immediately.\n # Otherwise it should be '1' when we want to load functions as we use them.\n # ... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | This should maybe go after the "At the HVM level" paragraph, since it makes it look like they are in the same section. | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/native-numbers.md b/docs/native-numbers.md
index 8bdc95e2..7838816b 100644
--- a/docs/native-numbers.md
+++ b/docs/native-numbers.md
@@ -49,14 +49,24 @@ minus_zero = -0.0
### Mixing number types
-The three number types are fundamentally different.
-If you mix two numbers of different types, HVM w... | [
"docs/native-numbers.md"
] | [
{
"comment": "This should maybe go after the \"At the HVM level\" paragraph, since it makes it look like they are in the same section.",
"path": "docs/native-numbers.md",
"hunk": "@@ -50,13 +50,26 @@ minus_zero = -0.0\n ### Mixing number types\n \n The three number types are fundamentally different.\n-I... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | Foo_C0 is repeated? | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/pattern-matching.md b/docs/pattern-matching.md
index 69068e17..148ed206 100644
--- a/docs/pattern-matching.md
+++ b/docs/pattern-matching.md
@@ -27,21 +27,21 @@ Matches on ADT constructors are compiled to different expressions depending on t
type Maybe = (Some val) | None
UnwrapOrZero x = match x ... | [
"docs/pattern-matching.md"
] | [
{
"comment": "Foo_C0 is repeated?",
"path": "docs/pattern-matching.md",
"hunk": "@@ -88,18 +88,20 @@ To ensure that recursive pattern matching functions don't loop in strict mode, i\n ```py\n # This is what the Foo function actually compiles to.\n # With -Olinearize-matches and -Ofloat-combinators (defa... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | This is not a doc comment, please dont use #{ #} syntax | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/src/fun/builtins.bend b/src/fun/builtins.bend
index 8b188bef..2d708f30 100644
--- a/src/fun/builtins.bend
+++ b/src/fun/builtins.bend
@@ -6,7 +6,7 @@ type List(T):
Nil
Cons { head: T, ~tail: List(T) }
-# Returns the length of a list and the list itself.
+#{ Returns a tuple containing the length and... | [
"src/fun/builtins.bend"
] | [
{
"comment": "This is not a doc comment, please dont use #{ #} syntax",
"path": "src/fun/builtins.bend",
"hunk": "@@ -717,103 +774,115 @@ String/encode_utf8 (String/Cons x xs) =\n }\n }\n \n-# Decodes a sequence of bytes to a String using ascii encoding.\n+#{ Decodes a sequence of bytes to a Strin... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | Update these comments to reflect what they actually do. You can follow the chain of switches to unterstand it. Also, preferably order them in a way that makes sense (Foo, then case0 then case0.case_false, etc) | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/pattern-matching.md b/docs/pattern-matching.md
index 69068e17..148ed206 100644
--- a/docs/pattern-matching.md
+++ b/docs/pattern-matching.md
@@ -27,21 +27,21 @@ Matches on ADT constructors are compiled to different expressions depending on t
type Maybe = (Some val) | None
UnwrapOrZero x = match x ... | [
"docs/pattern-matching.md"
] | [
{
"comment": "Update these comments to reflect what they actually do. You can follow the chain of switches to unterstand it. Also, preferably order them in a way that makes sense (Foo, then case0 then case0.case_false, etc)",
"path": "docs/pattern-matching.md",
"hunk": "@@ -88,18 +88,19 @@ To ensure tha... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | These 3 are not doc comments, just rtegular comments, use # instead | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/src/fun/builtins.bend b/src/fun/builtins.bend
index 8b188bef..2d708f30 100644
--- a/src/fun/builtins.bend
+++ b/src/fun/builtins.bend
@@ -6,7 +6,7 @@ type List(T):
Nil
Cons { head: T, ~tail: List(T) }
-# Returns the length of a list and the list itself.
+#{ Returns a tuple containing the length and... | [
"src/fun/builtins.bend"
] | [
{
"comment": "These 3 are not doc comments, just rtegular comments, use # instead",
"path": "src/fun/builtins.bend",
"hunk": "@@ -75,73 +76,80 @@ String/equals (String/Cons x xs) (String/Cons y ys) =\n }\n String/equals * * = 0\n \n-# Splits a list into two lists at the first occurrence of a value.\n+... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | What happened here? It should say that the mode should be 'r', 'w', 'a', 'rw'. (actually don't remember the modes by heart, might want to check) | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/src/fun/builtins.bend b/src/fun/builtins.bend
index 8b188bef..2d708f30 100644
--- a/src/fun/builtins.bend
+++ b/src/fun/builtins.bend
@@ -6,7 +6,7 @@ type List(T):
Nil
Cons { head: T, ~tail: List(T) }
-# Returns the length of a list and the list itself.
+#{ Returns a tuple containing the length and... | [
"src/fun/builtins.bend"
] | [
{
"comment": "What happened here? It should say that the mode should be 'r', 'w', 'a', 'rw'. (actually don't remember the modes by heart, might want to check)",
"path": "src/fun/builtins.bend",
"hunk": "@@ -366,21 +384,37 @@ def IO/sleep(seconds: f24) -> IO(None):\n ## File IO\n \n ### File IO primitive... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | The function signature is duplicated here, also comment missing for E | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/src/fun/builtins.bend b/src/fun/builtins.bend
index 8b188bef..2d708f30 100644
--- a/src/fun/builtins.bend
+++ b/src/fun/builtins.bend
@@ -6,7 +6,7 @@ type List(T):
Nil
Cons { head: T, ~tail: List(T) }
-# Returns the length of a list and the list itself.
+#{ Returns a tuple containing the length and... | [
"src/fun/builtins.bend"
] | [
{
"comment": "The function signature is duplicated here, also comment missing for E",
"path": "src/fun/builtins.bend",
"hunk": "@@ -717,103 +774,115 @@ String/encode_utf8 (String/Cons x xs) =\n }\n }\n \n-# Decodes a sequence of bytes to a String using ascii encoding.\n+#{ Decodes a sequence of by... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | Please use a consistent naming scheme for these cases, this is really confusing.
Either num_0/num_+ bool_false/bool_true etc
Or case_0/case_+ case_false/case_true etc.
What do you mean by route and handle?
```
0
0 true
0 false
0 false cons
0 false cons cons
0 false cons nil
0 false nil
+
+ false
+ t... | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/pattern-matching.md b/docs/pattern-matching.md
index 69068e17..148ed206 100644
--- a/docs/pattern-matching.md
+++ b/docs/pattern-matching.md
@@ -27,21 +27,21 @@ Matches on ADT constructors are compiled to different expressions depending on t
type Maybe = (Some val) | None
UnwrapOrZero x = match x ... | [
"docs/pattern-matching.md"
] | [
{
"comment": "Please use a consistent naming scheme for these cases, this is really confusing.\r\n\r\nEither num_0/num_+ bool_false/bool_true etc\r\nOr case_0/case_+ case_false/case_true etc.\r\n\r\nWhat do you mean by route and handle?\r\n\r\n```\r\n0\r\n0 true\r\n0 false\r\n0 false cons\r\n0 false cons cons\r... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | The syntax for constructors in this file is wrong everywhere, should be Bool/False, List/Cons, Maybe/Some, etc | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/pattern-matching.md b/docs/pattern-matching.md
index 69068e17..148ed206 100644
--- a/docs/pattern-matching.md
+++ b/docs/pattern-matching.md
@@ -27,21 +27,21 @@ Matches on ADT constructors are compiled to different expressions depending on t
type Maybe = (Some val) | None
UnwrapOrZero x = match x ... | [
"docs/pattern-matching.md"
] | [
{
"comment": "The syntax for constructors in this file is wrong everywhere, should be Bool/False, List/Cons, Maybe/Some, etc",
"path": "docs/pattern-matching.md",
"hunk": "@@ -60,20 +60,20 @@ They offer more advanced pattern matching capabilities and also take care linear\n Pattern matching equations ar... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | ```suggestion
Maybe/None = λMaybe/Some λMaybe/None Maybe/None
``` | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/pattern-matching.md b/docs/pattern-matching.md
index 69068e17..148ed206 100644
--- a/docs/pattern-matching.md
+++ b/docs/pattern-matching.md
@@ -27,21 +27,21 @@ Matches on ADT constructors are compiled to different expressions depending on t
type Maybe = (Some val) | None
UnwrapOrZero x = match x ... | [
"docs/pattern-matching.md"
] | [
{
"comment": "```suggestion\r\nMaybe/None = λMaybe/Some λMaybe/None Maybe/None\r\n```",
"path": "docs/pattern-matching.md",
"hunk": "@@ -27,21 +27,21 @@ Matches on ADT constructors are compiled to different expressions depending on t\n type Maybe = (Some val) | None\n \n UnwrapOrZero x = match x {\n- S... | true | ||
HigherOrderCO/Bend | 747 | comment_to_fix | Update, correct, and expand documentation | ```suggestion
Foo List/Nil = 0
Foo (List/Cons x List/Nil) = x
``` | a52cce7898a81ac0de9eed72d71d652176970d79 | 4979b1413f3f7afcafe62c2d8a8203c351d5611a | diff --git a/docs/pattern-matching.md b/docs/pattern-matching.md
index 69068e17..148ed206 100644
--- a/docs/pattern-matching.md
+++ b/docs/pattern-matching.md
@@ -27,21 +27,21 @@ Matches on ADT constructors are compiled to different expressions depending on t
type Maybe = (Some val) | None
UnwrapOrZero x = match x ... | [
"docs/pattern-matching.md"
] | [
{
"comment": "```suggestion\r\nFoo List/Nil = 0\r\nFoo (List/Cons x List/Nil) = x\r\n```",
"path": "docs/pattern-matching.md",
"hunk": "@@ -153,7 +153,7 @@ Foo _ = 3\n Hi (String/Cons 'h' (String/Cons 'i' String/Nil)) = 2\n Hi _ = 0\n \n-Foo List.nil = 0\n-Foo (List.cons x List.nil) = x\n+Foo List/nil =... | true | ||
HigherOrderCO/Bend | 743 | issue_to_patch | Updates builtin type Map so that it stores Maybes in its nodes. | ## Summary of Changes
The following updates have been made to `builtins.bend`:
### New/Updated Types and Functions
#### **1. `Maybe`**
- **New type definition:**
```bend
type Maybe(T):
Some {val: T}
None
```
#### **2. `Map`**
- **Updated type definition:**
```bend
type Map(T):
... | efc3b38137e8ad43aea10c55e0fd8d6371754c90 | 88db4e4589c55ac1a530084b325067cc12b87c98 | diff --git a/docs/builtins.md b/docs/builtins.md
index fc4733411..ee6f4c170 100644
--- a/docs/builtins.md
+++ b/docs/builtins.md
@@ -161,19 +161,44 @@ tree = ![![!1, !2],![!3, !4]]
```
Technically your trees don't need to end with leaves, but if you don't, your program will be very hard to reason about.
+## Maybe
... | [
"docs/builtins.md",
"src/fun/builtins.bend",
"tests/golden_tests.rs",
"tests/golden_tests/compile_file_o_all/match_adt_non_exhaustive.bend",
"tests/golden_tests/encode_pattern_match/match_adt_unscoped_lambda.bend",
"tests/golden_tests/encode_pattern_match/match_adt_unscoped_var.bend",
"tests/golden_test... | [
{
"comment": "Please put this file inside a `prelude` folder inside of `golden_tests`. The way you've done it, it's not running the tests and it messes the structure of the test suite.\r\n\r\nYou'll have to create a new corresponding test function in `golden_tests.rs`. You can just copy what `run_file` does I t... | diff --git a/tests/golden_tests.rs b/tests/golden_tests.rs
index 52bd8eddf..316f32698 100644
--- a/tests/golden_tests.rs
+++ b/tests/golden_tests.rs
@@ -471,6 +471,21 @@ fn io() {
})
}
+/// Runs a file that uses the prelude.
+#[test]
+fn prelude() {
+ run_golden_test_dir(function_name!(), &|code, path| {
+ le... | true | |
HigherOrderCO/Bend | 743 | comment_to_fix | Updates builtin type Map so that it stores Maybes in its nodes. | ```suggestion
if (key == 0):
```
to maintain the style | efc3b38137e8ad43aea10c55e0fd8d6371754c90 | 88db4e4589c55ac1a530084b325067cc12b87c98 | diff --git a/src/fun/builtins.bend b/src/fun/builtins.bend
index 29d94f0e7..8b188bef2 100644
--- a/src/fun/builtins.bend
+++ b/src/fun/builtins.bend
@@ -170,62 +170,111 @@ def Tree/reverse(tree: Tree(T)) -> Tree(T):
case Tree/Node:
return ![tree.right, tree.left]
-# MAP Impl
-
-type Map T = (Node (value: ... | [
"src/fun/builtins.bend"
] | [
{
"comment": "```suggestion\r\n if (key == 0):\r\n```\r\nto maintain the style ",
"path": "src/fun/builtins.bend",
"hunk": "@@ -170,62 +170,111 @@ def Tree/reverse(tree: Tree(T)) -> Tree(T):\n case Tree/Node:\n return ![tree.right, tree.left]\n \n-# MAP Impl\n+# BOOL Impl\n+type Bool:\n+ ... | true | ||
HigherOrderCO/Bend | 743 | comment_to_fix | Updates builtin type Map so that it stores Maybes in its nodes. | ```suggestion
return (got, Map/Node(map.value, rest, map.right))
```
Please fix the spacing here and anywhere else it might be missing | efc3b38137e8ad43aea10c55e0fd8d6371754c90 | 88db4e4589c55ac1a530084b325067cc12b87c98 | diff --git a/src/fun/builtins.bend b/src/fun/builtins.bend
index 29d94f0e7..8b188bef2 100644
--- a/src/fun/builtins.bend
+++ b/src/fun/builtins.bend
@@ -170,62 +170,111 @@ def Tree/reverse(tree: Tree(T)) -> Tree(T):
case Tree/Node:
return ![tree.right, tree.left]
-# MAP Impl
-
-type Map T = (Node (value: ... | [
"src/fun/builtins.bend"
] | [
{
"comment": "```suggestion\r\n return (got, Map/Node(map.value, rest, map.right))\r\n```\r\nPlease fix the spacing here and anywhere else it might be missing",
"path": "src/fun/builtins.bend",
"hunk": "@@ -170,62 +170,111 @@ def Tree/reverse(tree: Tree(T)) -> Tree(T):\n case Tree/Node:\n ... | true | ||
HigherOrderCO/Bend | 743 | comment_to_fix | Updates builtin type Map so that it stores Maybes in its nodes. | Don't use a `Bool` here, return a `u24` that is either `1` for true or `0` for false like we do everywhere else | efc3b38137e8ad43aea10c55e0fd8d6371754c90 | 88db4e4589c55ac1a530084b325067cc12b87c98 | diff --git a/src/fun/builtins.bend b/src/fun/builtins.bend
index 29d94f0e7..8b188bef2 100644
--- a/src/fun/builtins.bend
+++ b/src/fun/builtins.bend
@@ -170,62 +170,111 @@ def Tree/reverse(tree: Tree(T)) -> Tree(T):
case Tree/Node:
return ![tree.right, tree.left]
-# MAP Impl
-
-type Map T = (Node (value: ... | [
"src/fun/builtins.bend"
] | [
{
"comment": "Don't use a `Bool` here, return a `u24` that is either `1` for true or `0` for false like we do everywhere else",
"path": "src/fun/builtins.bend",
"hunk": "@@ -170,62 +170,111 @@ def Tree/reverse(tree: Tree(T)) -> Tree(T):\n case Tree/Node:\n return ![tree.right, tree.left]\n \n-... | true | ||
HigherOrderCO/Bend | 743 | comment_to_fix | Updates builtin type Map so that it stores Maybes in its nodes. | This function consumes `map` which will force a non-linear use, meaning a lot of duplications.
Instead, it should reconstruct `map` and return it together with the main result like we do on `Map/get` | efc3b38137e8ad43aea10c55e0fd8d6371754c90 | 88db4e4589c55ac1a530084b325067cc12b87c98 | diff --git a/src/fun/builtins.bend b/src/fun/builtins.bend
index 29d94f0e7..8b188bef2 100644
--- a/src/fun/builtins.bend
+++ b/src/fun/builtins.bend
@@ -170,62 +170,111 @@ def Tree/reverse(tree: Tree(T)) -> Tree(T):
case Tree/Node:
return ![tree.right, tree.left]
-# MAP Impl
-
-type Map T = (Node (value: ... | [
"src/fun/builtins.bend"
] | [
{
"comment": "This function consumes `map` which will force a non-linear use, meaning a lot of duplications.\r\n\r\nInstead, it should reconstruct `map` and return it together with the main result like we do on `Map/get`",
"path": "src/fun/builtins.bend",
"hunk": "@@ -170,62 +170,111 @@ def Tree/reverse... | true | ||
HigherOrderCO/Bend | 743 | comment_to_fix | Updates builtin type Map so that it stores Maybes in its nodes. | Why are you destroying this leaf here? You should just return `Map/Leaf` like it used to be | efc3b38137e8ad43aea10c55e0fd8d6371754c90 | 88db4e4589c55ac1a530084b325067cc12b87c98 | diff --git a/src/fun/builtins.bend b/src/fun/builtins.bend
index 29d94f0e7..8b188bef2 100644
--- a/src/fun/builtins.bend
+++ b/src/fun/builtins.bend
@@ -170,62 +170,111 @@ def Tree/reverse(tree: Tree(T)) -> Tree(T):
case Tree/Node:
return ![tree.right, tree.left]
-# MAP Impl
-
-type Map T = (Node (value: ... | [
"src/fun/builtins.bend"
] | [
{
"comment": "Why are you destroying this leaf here? You should just return `Map/Leaf` like it used to be",
"path": "src/fun/builtins.bend",
"hunk": "@@ -170,62 +170,111 @@ def Tree/reverse(tree: Tree(T)) -> Tree(T):\n case Tree/Node:\n return ![tree.right, tree.left]\n \n-# MAP Impl\n+# BOOL ... | true | ||
HigherOrderCO/Bend | 743 | comment_to_fix | Updates builtin type Map so that it stores Maybes in its nodes. | This function should not destroy the input `map` and instead reconstruct it and return it like `Map/get` does | efc3b38137e8ad43aea10c55e0fd8d6371754c90 | 88db4e4589c55ac1a530084b325067cc12b87c98 | diff --git a/src/fun/builtins.bend b/src/fun/builtins.bend
index 29d94f0e7..8b188bef2 100644
--- a/src/fun/builtins.bend
+++ b/src/fun/builtins.bend
@@ -170,62 +170,111 @@ def Tree/reverse(tree: Tree(T)) -> Tree(T):
case Tree/Node:
return ![tree.right, tree.left]
-# MAP Impl
-
-type Map T = (Node (value: ... | [
"src/fun/builtins.bend"
] | [
{
"comment": "This function should not destroy the input `map` and instead reconstruct it and return it like `Map/get` does",
"path": "src/fun/builtins.bend",
"hunk": "@@ -170,62 +170,111 @@ def Tree/reverse(tree: Tree(T)) -> Tree(T):\n case Tree/Node:\n return ![tree.right, tree.left]\n \n-# ... | true | ||
HigherOrderCO/Bend | 743 | comment_to_fix | Updates builtin type Map so that it stores Maybes in its nodes. | Same for the tests that defined Maybe | efc3b38137e8ad43aea10c55e0fd8d6371754c90 | 88db4e4589c55ac1a530084b325067cc12b87c98 | diff --git a/tests/golden_tests/compile_file_o_all/match_adt_non_exhaustive.bend b/tests/golden_tests/compile_file_o_all/match_adt_non_exhaustive.bend
index 8a97cad1d..97c526753 100644
--- a/tests/golden_tests/compile_file_o_all/match_adt_non_exhaustive.bend
+++ b/tests/golden_tests/compile_file_o_all/match_adt_non_exh... | [
"tests/golden_tests/compile_file_o_all/match_adt_non_exhaustive.bend"
] | [
{
"comment": "Same for the tests that defined Maybe",
"path": "tests/golden_tests/compile_file_o_all/match_adt_non_exhaustive.bend",
"hunk": "@@ -1,9 +1,7 @@\n-type Maybe = (Some val) | None",
"resolving_sha": "88db4e4589c55ac1a530084b325067cc12b87c98",
"resolving_diff": "diff --git a/tests/gold... | true | ||
HigherOrderCO/Bend | 743 | comment_to_fix | Updates builtin type Map so that it stores Maybes in its nodes. | You broke this test | efc3b38137e8ad43aea10c55e0fd8d6371754c90 | 88db4e4589c55ac1a530084b325067cc12b87c98 | diff --git a/tests/snapshots/encode_pattern_match__match_adt_unscoped_lambda.bend.snap b/tests/snapshots/encode_pattern_match__match_adt_unscoped_lambda.bend.snap
index d53c30f3c..9deb7b068 100644
--- a/tests/snapshots/encode_pattern_match__match_adt_unscoped_lambda.bend.snap
+++ b/tests/snapshots/encode_pattern_match_... | [
"tests/snapshots/encode_pattern_match__match_adt_unscoped_lambda.bend.snap"
] | [
{
"comment": "You broke this test",
"path": "tests/snapshots/encode_pattern_match__match_adt_unscoped_lambda.bend.snap",
"hunk": "@@ -2,28 +2,7 @@\n source: tests/golden_tests.rs\n input_file: tests/golden_tests/encode_pattern_match/match_adt_unscoped_lambda.bend\n ---\n-Scott\n-unchecked main: Any\n-(m... | true | ||
HigherOrderCO/Bend | 743 | comment_to_fix | Updates builtin type Map so that it stores Maybes in its nodes. | You broke this test. I'm guessing it defined its own Maybe and you removed that | efc3b38137e8ad43aea10c55e0fd8d6371754c90 | 88db4e4589c55ac1a530084b325067cc12b87c98 | diff --git a/tests/snapshots/run_file__unbound_wrap.bend.snap b/tests/snapshots/run_file__unbound_wrap.bend.snap
index 552967160..1fb44adf2 100644
--- a/tests/snapshots/run_file__unbound_wrap.bend.snap
+++ b/tests/snapshots/run_file__unbound_wrap.bend.snap
@@ -5,4 +5,4 @@ input_file: tests/golden_tests/run_file/unbound... | [
"tests/snapshots/run_file__unbound_wrap.bend.snap"
] | [
{
"comment": "You broke this test. I'm guessing it defined its own Maybe and you removed that",
"path": "tests/snapshots/run_file__unbound_wrap.bend.snap",
"hunk": "@@ -4,5 +4,5 @@ input_file: tests/golden_tests/run_file/unbound_wrap.bend\n ---\n \u001b[4m\u001b[1m\u001b[31mErrors:\u001b[0m\n \u001b[1mI... | true | ||
HigherOrderCO/Bend | 743 | comment_to_fix | Updates builtin type Map so that it stores Maybes in its nodes. | For the other types we've been writing the names in full, so
`Some { value: T }`
Also see the spacing | efc3b38137e8ad43aea10c55e0fd8d6371754c90 | 88db4e4589c55ac1a530084b325067cc12b87c98 | diff --git a/src/fun/builtins.bend b/src/fun/builtins.bend
index 29d94f0e7..8b188bef2 100644
--- a/src/fun/builtins.bend
+++ b/src/fun/builtins.bend
@@ -170,62 +170,111 @@ def Tree/reverse(tree: Tree(T)) -> Tree(T):
case Tree/Node:
return ![tree.right, tree.left]
-# MAP Impl
-
-type Map T = (Node (value: ... | [
"src/fun/builtins.bend"
] | [
{
"comment": "For the other types we've been writing the names in full, so\r\n`Some { value: T }`\r\n\r\nAlso see the spacing",
"path": "src/fun/builtins.bend",
"hunk": "@@ -170,62 +170,110 @@ def Tree/reverse(tree: Tree(T)) -> Tree(T):\n case Tree/Node:\n return ![tree.right, tree.left]\n \n-... | true | ||
HigherOrderCO/Bend | 743 | comment_to_fix | Updates builtin type Map so that it stores Maybes in its nodes. | We've been using `(value, structure)` for these linear functions. See the type for `List/length` and `Map/get` | efc3b38137e8ad43aea10c55e0fd8d6371754c90 | 88db4e4589c55ac1a530084b325067cc12b87c98 | diff --git a/src/fun/builtins.bend b/src/fun/builtins.bend
index 29d94f0e7..8b188bef2 100644
--- a/src/fun/builtins.bend
+++ b/src/fun/builtins.bend
@@ -170,62 +170,111 @@ def Tree/reverse(tree: Tree(T)) -> Tree(T):
case Tree/Node:
return ![tree.right, tree.left]
-# MAP Impl
-
-type Map T = (Node (value: ... | [
"src/fun/builtins.bend"
] | [
{
"comment": "We've been using `(value, structure)` for these linear functions. See the type for `List/length` and `Map/get`",
"path": "src/fun/builtins.bend",
"hunk": "@@ -170,62 +170,110 @@ def Tree/reverse(tree: Tree(T)) -> Tree(T):\n case Tree/Node:\n return ![tree.right, tree.left]\n \n-#... | true | ||
HigherOrderCO/Bend | 743 | comment_to_fix | Updates builtin type Map so that it stores Maybes in its nodes. | Same thing here about the order of the return values | efc3b38137e8ad43aea10c55e0fd8d6371754c90 | 88db4e4589c55ac1a530084b325067cc12b87c98 | diff --git a/src/fun/builtins.bend b/src/fun/builtins.bend
index 29d94f0e7..8b188bef2 100644
--- a/src/fun/builtins.bend
+++ b/src/fun/builtins.bend
@@ -170,62 +170,111 @@ def Tree/reverse(tree: Tree(T)) -> Tree(T):
case Tree/Node:
return ![tree.right, tree.left]
-# MAP Impl
-
-type Map T = (Node (value: ... | [
"src/fun/builtins.bend"
] | [
{
"comment": "Same thing here about the order of the return values",
"path": "src/fun/builtins.bend",
"hunk": "@@ -170,62 +170,110 @@ def Tree/reverse(tree: Tree(T)) -> Tree(T):\n case Tree/Node:\n return ![tree.right, tree.left]\n \n-# MAP Impl\n-\n-type Map T = (Node (value: T) ~(left: (Map ... | true | ||
HigherOrderCO/Bend | 743 | comment_to_fix | Updates builtin type Map so that it stores Maybes in its nodes. | ```suggestion
let diagnostics_cfg = DiagnosticsConfig::new(Severity::Error, true);
```
There shouldn't be any warnings in the prelude library, so we can just error on them | efc3b38137e8ad43aea10c55e0fd8d6371754c90 | 88db4e4589c55ac1a530084b325067cc12b87c98 | diff --git a/tests/golden_tests.rs b/tests/golden_tests.rs
index 52bd8eddf..316f32698 100644
--- a/tests/golden_tests.rs
+++ b/tests/golden_tests.rs
@@ -471,6 +471,21 @@ fn io() {
})
}
+/// Runs a file that uses the prelude.
+#[test]
+fn prelude() {
+ run_golden_test_dir(function_name!(), &|code, path| {
+ le... | [
"tests/golden_tests.rs"
] | [
{
"comment": "```suggestion\r\n let diagnostics_cfg = DiagnosticsConfig::new(Severity::Error, true);\r\n```\r\nThere shouldn't be any warnings in the prelude library, so we can just error on them",
"path": "tests/golden_tests.rs",
"hunk": "@@ -471,6 +471,21 @@ fn io() {\n })\n }\n \n+/// Runs a fil... | true | ||
HigherOrderCO/Bend | 743 | comment_to_fix | Updates builtin type Map so that it stores Maybes in its nodes. | Please end all files with a new line | efc3b38137e8ad43aea10c55e0fd8d6371754c90 | 88db4e4589c55ac1a530084b325067cc12b87c98 | diff --git a/tests/golden_tests/prelude/map_contains_test.bend b/tests/golden_tests/prelude/map_contains_test.bend
new file mode 100644
index 000000000..ca8c6abfb
--- /dev/null
+++ b/tests/golden_tests/prelude/map_contains_test.bend
@@ -0,0 +1,3 @@
+def main() -> _:
+ m1 = {0: 23}
+ return Map/contains(m1, 3)
| [
"tests/golden_tests/prelude/map_contains_test.bend"
] | [
{
"comment": "Please end all files with a new line",
"path": "tests/golden_tests/prelude/map_contains_test.bend",
"hunk": "@@ -0,0 +1,3 @@\n+def main():\n+ m1 = {0: 42, 1: 7, 2: 13, 3: 255, 4: 100} \n+ return Map/contains(m1, 3)",
"resolving_sha": "88db4e4589c55ac1a530084b325067cc12b87c98",
"r... | true | ||
HigherOrderCO/Bend | 743 | comment_to_fix | Updates builtin type Map so that it stores Maybes in its nodes. | Can you add the types here? | efc3b38137e8ad43aea10c55e0fd8d6371754c90 | 88db4e4589c55ac1a530084b325067cc12b87c98 | diff --git a/docs/builtins.md b/docs/builtins.md
index fc4733411..ee6f4c170 100644
--- a/docs/builtins.md
+++ b/docs/builtins.md
@@ -161,19 +161,44 @@ tree = ![![!1, !2],![!3, !4]]
```
Technically your trees don't need to end with leaves, but if you don't, your program will be very hard to reason about.
+## Maybe
... | [
"docs/builtins.md"
] | [
{
"comment": "Can you add the types here?",
"path": "docs/builtins.md",
"hunk": "@@ -173,7 +198,7 @@ type Map:\n **`Map`** represents a tree with values stored in the branches.\n It is meant to be used as an efficient map data structure with integer keys and O(log n) read and write operations.\n \n-- **... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.