fork(1) download
  1. let map1 = Map.ofList [("A", "1"); ("B", "2"); ("C", "3")]
  2.  
  3. map1 |> printfn "%A"
  4.  
  5. let rev map: Map<string,string> =
  6. Map.fold (fun m key value -> m.Add(value,key)) Map.empty map
  7.  
  8. rev map1 |> printfn "%A"
  9.  
Success #stdin #stdout 0.21s 26408KB
stdin
Standard input is empty
stdout
map [("A", "1"); ("B", "2"); ("C", "3")]
map [("1", "A"); ("2", "B"); ("3", "C")]