I wonder if F# has a function called "flat" to flatter a map to be a list, like from
{(1,"hello"),(2, "world")}
to
{1, "hello", 2, "world"}.
Scala has this function, does F# has?
In other words, could a F# list contain elements with different types? Thanks.
F# doesn't have a type of "lists with differently typed elements", but you can do the following.
First, you can convert between maps and lists of pairs:
Then you can cast the components in each pair to object, then flatten that into a list of objects:
I don't know how helpful this is in practice, though.