Any lambda function in this form (fun x -> fx) can be expressed as f . Keeping the same state.
In your code, you have fun acc el -> Array.append acc el , which is of the same type and does the same as Array.append , so you can shorten it to:
Array.fold Array.append [||] arr2d
source share