So I have a function like so
let test (item: 'a ) (factors: items) : ('b list) =
....
This function takes in an item of some 'a elements and my own items type, which is another list of items I pass to it. I return a list of a different type later after doing some stuff
How do I use List.fold_left with this function so that if I have a list of 'a items, I can just apply test to each one individually, and pass 'factors' to all of them, and then so that I can concatenate the resultant 'b type lists for each one.
For example, the I would need to process the following list:
[somea; someb; somec]
as
(test somea factors)@(test someb factors)@(test somec factors)
Is this a task that List.fold_left is not applicable for? Is there some other function I can use? I can't recursively traverse and call the function because of some mutually-recursive problems going on with the other methods in my code so is there another way? Would List.map be useful here instead?