Suppose I have a list of decimal*decimal
let tup = [(1M, 2M); (2M, 3M); (3M, 3M); (4M, 5M); (5M, 6M); (7M, 6M); (8M, 9M); (10M, 9M)]
I need a function that can group all of the values together if they can be connected, e.g.,
map[(100, [1M; 2M; 3M]); (101, [4M; 5M; 6M; 7M]); (102, [8M; 9M; 10M])]
I can't just do a List.groupBy
because that misses anything else that may be connected "down the line" by another decimal value. The int
values in the map are arbitrary. I'd like to be able to "seed" the starting value then increase each incrementally by some value.
What's the function look like that can do this?