I need to create a single list from a list of lists using the List.map property in f#. This is what i got so far.
let lst1 = [[1;2;3;4];[5;6;7;8]]
let concat (list: 'a list list) =
let li = []
let q = List.map(fun (x: 'a list) -> x @ li ) list
li
printfn "%A" (concat lst1)
I expect the output
li = [1;2;3;4;5;6;7;8]
but get an empty list instead.
I don't get why the list is empty. I'm adding to the list li in the List.map function