Skip to content

Commit

Permalink
modify freefrom exercise in pipelines
Browse files Browse the repository at this point in the history
Is now later in order but also more complex
  • Loading branch information
GoNZooo committed Aug 16, 2021
1 parent 39cf257 commit 0dfa8bf
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions basics/01-values-and-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -563,19 +563,20 @@ solution upperBound divisors =

### Exercises (Pipelines using partial application)

1. Define a function that takes the last 3 elements of a `[Int]`. Use notes as inspiration.

2. Define a function using a pipeline that takes a list of `Int`, gets all the even numbers in it,
1. Define a function using a pipeline that takes a list of `Int`, gets all the even numbers in it,
multiplies them all by two and returns the sum[1]. Define versions that use:
- a named argument; with `&`
- an unnamed argument; with `>>>`

3. Define a function using a pipeline that takes a list of `Int`, gets all the even numbers in the
2. Define a function using a pipeline that takes a list of `Int`, gets all the even numbers in the
beginning of the list[2], multiplies them all by two, sums them up and returns whether or not the
sum is even. Define versions that use:
- a named argument; with `&`
- an unnamed argument; with `>>>`

3. Define a function that takes the last 3 elements of a `[Int]` and gets the average of them. Use
notes as inspiration.

4. Define a function using a pipeline that takes a list of strings, takes all the strings that begin
with "#", then discards all leading "#" or " " from the resulting strings. Take note of what kind
of structure you are working with and what we need to do to work with the structures inside.
Expand Down

0 comments on commit 0dfa8bf

Please sign in to comment.