Microsoft (R) F# 2.0 Interactive build 2.0.0.0 Copyright (c) Microsoft Corporation. All Rights Reserved. For help type #help;; > let map_1 = Map.ofList[ (1, "one"); (2, "two"); (3, "three"); (4, "four") ];; val map_1 : Map<int,string> = map [(1, "one"); (2, "two"); (3, "three"); (4, "four")]
Friday, January 21, 2011
Studying F# : Map
Labels:
F#
I wrote this post : phosphorescence: Studying F# : Dictionary (a.k.a. Hash or Map). But it is incorrect. Map is there! Map must be created by using List, Tuple and the function Map.ofList.
2 comments:
You can just do Map[1, "one"; 2, "two"; 3, "three"; 4, "four"]
Thanks a lot
Post a Comment