Add explanation of folding to the map fold

This commit is contained in:
John David Pressman 2019-11-26 05:39:54 -08:00
parent ebaa913c5a
commit d23819245f

View File

@ -135,6 +135,13 @@ let map_op (m : ledger) : ledger =
`fold` is an aggregation function that return the combination of a maps contents.
The fold is a loop which extracts an element of the map on each iteration. It then
provides this element and an existing value to a folding function which combines them.
On the first iteration, the existing value is an initial expression given by the
programmer. On each subsequent iteration it is the result of the previous iteration.
It eventually returns the result of combining all the elements.
<!--DOCUSAURUS_CODE_TABS-->
<!--Pascaligo-->
```pascaligo