Reading diagrams / Topic 25 of 42
The quiet line: forks, steps and loops
The rule
Low in the wall is the quiet line. Each package has a tick with its name, and under it sit the parts of that package that no mark above draws. The map draws only the marks an entry makes itself, so a part here may still run inside code a path calls.
Three prongs with a type are a fork: a choice made by comparing a plain String or Int, such as looking up a case by name. On a path, the fork hangs under the check or socket that makes the choice; otherwise it sits on the quiet line.
A loop arrow with a type is a step: functions in that package take a value of that type and return the next one, like a reducer stepping a store. A loop arrow marked with two types joined by in, such as Problem in Reply, takes a value of the first type and gives one back only inside the second. An arc closing between two packages is a loop: values of those types go round between them.
The words “for any a, b” before a part's name, as before create_store, say the part is generic over the types a and b. It works for values of any type in those places, so it can only pass them along: it never looks inside them. A part with no “for any” has fixed types.
A library can also put a value together from parts. Curves gather the parts on the right into the value they make on the left: in redux-todos, app_reducer combines visibility_reducer and todos_reducer, and store is made by a call, named under it as create_store(..). The leftmost value meets the wall, at an opening when it is exported.
- Prongs with the type confirm a choice on it; none anywhere rules it out.
- A loop arrow with the type confirms a step; an arc between packages confirms a loop.
- “for any” before a part confirms it is generic; none rules it out.
redux-todos: a small copy of a Redux todo app.
Loading the system map.
cosmic-python: a copy of the allocation service from Cosmic Python, as a library.
Loading the system map.
How to read this: what each mark in these pictures means
Loading the worked examples and practice.