diff options
author | Edoardo La Greca | 2025-09-08 21:24:11 +0200 |
---|---|---|
committer | Edoardo La Greca | 2025-09-08 21:24:11 +0200 |
commit | c524968f3e4247ca674fe112a0b8e7081ab65b19 (patch) | |
tree | 583f672cab50a76bac311c419532b739b20dc46f /lec07 | |
parent | 778bf11ad081e654e788baec89de40c272e34db7 (diff) |
rephrase last paragraph
Diffstat (limited to 'lec07')
-rw-r--r-- | lec07/notes.md | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lec07/notes.md b/lec07/notes.md index 04b7640..b59d6e9 100644 --- a/lec07/notes.md +++ b/lec07/notes.md @@ -52,5 +52,7 @@ If we rewrite `treeSize` and `treeFlatten` with our brand-new `treeFold`, we get ### Folds in general -The reason why we just implemented a fold for trees is that folds are not necessarily restricted to lists, but they can be applied to many more data structures. In general, fold functions for any type `T` take one argument for each of `T`'s constructors, each being a function which instructs the fold about how to translate the respective constructor into a value suitable for the final result. Many functions are expressible as simple folds. +The reason why we just implemented a fold for trees is to state a fact: folds are not necessarily restricted to lists, but they can be applied to many more data structures. + +In general, a fold function for any given type `T` takes one argument for each of `T`'s constructors. Each of these arguments is a function that indicates how to translate the respective constructor and combine its data into an expression suitable for the final result. Many functions are expressible as simple folds, that's why it's important to grasp its concept. |