Skip to content

Commit

Permalink
Feedback from review
Browse files Browse the repository at this point in the history
  • Loading branch information
lpil committed Sep 28, 2023
1 parent 7138d83 commit fd1a7b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions concepts/use-expressions/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

In Gleam it is common to write and use higher order functions, that is functions that take other functions as arguments. Sometimes when using many higher order functions at once the code can become difficult to read, with many layers of indentation.

For example, here is a function that calls several functions that return `Result(Int, Nil)`, and sums the values if all three are successful.
For example, here is a function that calls several functions that return `Result(Int, Nil)`, and sums the values if all four are successful.

```gleam
import gleam/result
Expand Down Expand Up @@ -34,7 +34,7 @@ pub fn main() -> Result(Int, Nil) {
}
```

A `use` expression collects all the following statements in the block into and passes it as a callback function as the final argument to the function call. The variables between the `use` keyword and the `<-` symbol are the names of the arguments that will be passed to the callback function.
A `use` expression collects all the following statements in the block and passes it as a callback function as the final argument to the function call. The variables between the `use` keyword and the `<-` symbol are the names of the arguments that will be passed to the callback function.

```gleam
// This use expression
Expand Down
4 changes: 2 additions & 2 deletions exercises/concept/expert-experiments/.docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

In Gleam it is common to write and use higher order functions, that is functions that take other functions as arguments. Sometimes when using many higher order functions at once the code can become difficult to read, with many layers of indentation.

For example, here is a function that calls several functions that return `Result(Int, Nil)`, and sums the values if all three are successful.
For example, here is a function that calls several functions that return `Result(Int, Nil)`, and sums the values if all four are successful.

```gleam
import gleam/result
Expand Down Expand Up @@ -36,7 +36,7 @@ pub fn main() -> Result(Int, Nil) {
}
```

A `use` expression collects all the following statements in the block into and passes it as a callback function as the final argument to the function call. The variables between the `use` keyword and the `<-` symbol are the names of the arguments that will be passed to the callback function.
A `use` expression collects all the following statements in the block and passes it as a callback function as the final argument to the function call. The variables between the `use` keyword and the `<-` symbol are the names of the arguments that will be passed to the callback function.

```gleam
// This use expression
Expand Down

0 comments on commit fd1a7b5

Please sign in to comment.