# HG changeset patch # User Tuomo Valkonen # Date 1587426429 18000 # Node ID c4c2ab568324e37458f2e41f5eb5b1465719c077 # Parent fc1ce359bb51d5c1ee4bacda7f9dc862b5591b5b Improve example in README diff -r fc1ce359bb51 -r c4c2ab568324 README.md --- a/README.md Mon Apr 20 13:20:28 2020 -0500 +++ b/README.md Mon Apr 20 18:47:09 2020 -0500 @@ -39,9 +39,17 @@ This package is not and is not planned to be available via `Pkg.add` as it is based on the worst and must unusable version control system ever invented: Git. -## Iterative algorithms example +## Iterative algorithms in a functional fashion + +The package includes `simple_iterate` which helps separating the computational step of iterative algorithms from visualisation and other reporting routines. +It is merely intended to serve as a template, as different applications require different visualisation routines to be implemented in a replacement of `simple_iterate`; in particular [ImageTools][] implements its own version. -The package includes `simple_iterate` which helps separating the computational step of iterative algorithms for visualisation routines. It is merely intended to serve as a template, as different applications require different visualisation routines to be implemented in a replacement of `simple_iterate`. The computational step is implemented as a `do`-block anonymous function that gets passed another function is a parameter for doing the verbosity on request. Example: +The approach is heavily indebted to functional programming. +The computational step is to be implemented as a `do`-block anonymous function. +That function gets passed another function `verbose` as a parameter. +To (potentially) report the current status, the computational step only needs to call `verbose` with yet another function as a parameter. Whether the status is actually reported—and whether it needs to be calculated—is decided by `verbose`, and its parameter called as needed. + +### Simple example ```julia using AlgTools.Iterate