This is an example of my current code:
DataSet = [1,2,3,4,5,6,7,8,9]. Sequence = [3,4,5,6]. ReducedDataSet = lists:foldl( fun(SeqNumber, Output) -> Row = lists:nth(SeqNumber, DataSet), [Row|Output] end, [], Sequence ).
The ReducedDataSet ends as [6,5,4,3], and if I change it to lists: foldr, the ReducedDataSet will be [3,4,5,6].
I did not expect this, as if it was absorbed from left to right, the third value is 3 and should continue to 6, but when absorbed from right to left, the 3rd value will be 7 and go to 4.
Does this mean that my list has a hidden line number, and foldl and foldr differ only in the sort order of the final list?
source share