I'm curious how the module / list type in F # works, in particular, does it optimize this?
let xs = ["1"; "2"; "3"]
let ys = "0"::xs
let zs = ["hello"; "world"]@xs
I looked at the source part https://github.com/fsharp/fsharp/blob/68e37d03dfc15f8105aeb0ac70b846f82b364901/src/fsharp/FSharp.Core/prim-types.fs#L3493 , it seems to be in the corresponding area.
I would like to know if it was copied xsat creation ys.
I would have thought it was just easy to point to an existing list if you just carry an element.
If you are concatenating, I suppose this may not be possible, since this would require changing the last element of the list to point to the next?
If someone can annotate / paste code snippets from FSharp.Core, that would be ideal.