How can i convert between F# List and F# Tuple?
- by ksharp
Is there some way to convert between F# List and F# Tuple?
For example:
[1;2;3] -> (1,2,3)
(1,2,3,4) -> [1;2;3;4]
I need two Functions to do that:
let listToTuple list = ...
let tupleToList tuple = ...
Thank you in advance.
I think reflection is necessary to this problem.
I know the performance is not good.
I have to pay the cost of breaking functional programming rule.