Doc needs help
The example says:
the last two arguments [of foldl/4-7] form a typical difference pair
That's definitely not right. These values may not even be lists! They form the start and the end of a data-flowing "accumulator" chain (or "weave") though.
Companion README
A companion README
with several examples (and an implementation of foldr/4) can be found here
Super Simple Explainer
The key is: foldl(Goal,[a,b,c,d],Starter,Final)
sets up a dataflow pipeline like this:
Starter -->--Goal-->--Goal-->--Goal-->--Goal-->--Final ^ ^ ^ ^ | | | | [ a , b , c , d ]
And Goal is called with parameters whose name should be this:
Goal(Element,FromLeft,ToRight) for single list Goal(Element1,Element2,FromLeft,ToRight) for two lists Goal(Element1,Element2,Element3,FromLeft,ToRight) for three lists Goal(Element1,Element2,Element3,Element4,FromLeft,ToRight) for four lists
... and that's all one really needs to know.