Skip to content

Commit

Permalink
Headings for exercises
Browse files Browse the repository at this point in the history
  • Loading branch information
noelwelsh committed Oct 4, 2023
1 parent 34497f8 commit 5882b16
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pages/adt/structural-corecursion.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ counter = 0
MyList.fill(5)(getAndInc())
```

#### Exercise {-}
#### Exercise: Iterate {-}

Implement `iterate` using the same reasoning as we did for `fill`.
This is slightly more complex than `fill` as we need to keep to bits of information: the value of the counter and the current value of type `A`.
Expand Down Expand Up @@ -368,6 +368,9 @@ MyList.iterate(0, 5)(x => x - 1)
```
</div>


#### Exercise: Map {-}

Once you've completed `iterate`, try to implement `map` in terms of `unfold`.

<div class="solution">
Expand Down

0 comments on commit 5882b16

Please sign in to comment.