sorting - Order a List in f # -
first of im noob in f# sorry if question stupid
i have list 1700 strings. of these strings repeated. want create list in each position there list unique string (but if string repeated want both of strings inside list).
so example if have list
[are; hi; how; you; hi; hi; are; how]
i want this
[[hi; hi; hi];[how; how];[are;are];[you]]
thanks help!!!
the msdn documentation page seq.groupby
function has sample showing how use function. sample uses sequence input, work lists too:
let sequence = [ 1 .. 100 ] let grouped = sequence |> seq.groupby (fun value -> if (value % 2 = 0) 0 else 1) grouped |> printfn "%a"
so, need make work scenario change function returns key (here 1 or 0) each value
list (in example, key value itself).
Comments
Post a Comment