{"id":6691,"date":"2014-11-26T23:06:53","date_gmt":"2014-11-26T14:06:53","guid":{"rendered":"http:\/\/www.moonmile.net\/blog\/?p=6691"},"modified":"2014-11-29T12:06:20","modified_gmt":"2014-11-29T03:06:20","slug":"c-%e3%81%ae-dictionary-%e3%81%a8-f-%e3%81%ae-map","status":"publish","type":"post","link":"https:\/\/www.moonmile.net\/blog\/archives\/6691","title":{"rendered":"C# \u306e Dictionary \u3068 F# \u306e map"},"content":{"rendered":"<p>\u3061\u3087\u3063\u3068\u6c17\u306b\u306a\u3063\u305f\u306e\u3067\u30e1\u30e2\u66f8\u304d<\/p>\n<p>C# \u306e Dictonary \u306f <a href=\"https:\/\/github.com\/Microsoft\/referencesource\/blob\/master\/mscorlib\/system\/collections\/generic\/dictionary.cs\">referencesource\/mscorlib\/system\/collections\/generic\/dictionary.cs<\/a> \u306b\u3042\u3063\u3066\u3001buckets[hashCode % buckets.Length] \u306a\u5f62\u3067\u30cf\u30c3\u30b7\u30e5\u5024\u3067\u8a08\u7b97\u3002<\/p>\n<p>F# \u306e map \u306f <a href=\"https:\/\/github.com\/fsharp\/fsharp\/blob\/master\/src\/fsharp\/FSharp.Core\/map.fs\">fsharp\/src\/fsharp\/FSharp.Core\/map.fs<\/a> \u306b\u3042\u3063\u3066\u3001comparer \u3092\u4f7f\u3063\u3066\u4e8c\u5206\u6728<\/p>\n<p>\u3061\u306a\u307f\u306b C# \u306e SortedDictionary \u306f <a href=\"https:\/\/github.com\/Microsoft\/referencesource\/blob\/master\/System\/compmod\/system\/collections\/generic\/sorteddictionary.cs\">referencesource\/System\/compmod\/system\/collections\/generic\/sorteddictionary.cs<\/a> \u306b\u3042\u3063\u3066\u3001TreeSet&lt;KeyValuePair&lt;TKey, TValue&gt;&gt; \u306a\u4e8c\u5206\u6728\u3067\u8a08\u7b97\u3002<\/p>\n<p>ReadOnlyDictonary \u3063\u3066\u306e\u3082\u3042\u308b\u3002 <a href=\"https:\/\/github.com\/Microsoft\/referencesource\/blob\/master\/mscorlib\/system\/collections\/objectmodel\/readonlydictionary.cs\">\u3053\u3053<\/a> \u306b\u30bd\u30fc\u30b9\u304c\u3042\u308b\u306e\u3067\u898b\u308b\u3068\u3001dictonary \u3092\u6e21\u3057\u3066\u3044\u308b\u3060\u3051\u306a\u306e\u3067\u3001\u4e2d\u8eab\u306f\u4e00\u7dd2\u3002\u8ffd\u52a0\u7528\u306e\u30e1\u30bd\u30c3\u30c9\u304c\u306a\u3044\u3060\u3051\u3002\u540c\u3058\u3088\u3046\u306b ReadOnlyCollection \u304c\u3042\u308b\u3051\u3069\u3001\u5185\u90e8\u7684\u306b\u306f IList \u3068\u540c\u3058\u3002\u306a\u306e\u3067\u3001\u975e\u540c\u671f\u306b\u7279\u5316\u3057\u3066\u3044\u308b\u3068\u304b\u3001\u5206\u6563\u3055\u308c\u3066\u3044\u308b\u3068\u304b\u3001\u3068\u3044\u3046\u8a33\u3067\u306f\u306a\u3044\u3089\u3057\u3044\u3002\u9006\u306b\u8a00\u3048\u3070\u3001\u521d\u671f\u5316\u3059\u308b\u3068\u304d\u306b\u5206\u6563\u306b\u7279\u5316\u3055\u305b\u305f\u30ea\u30b9\u30c8\u3092\u6e21\u305b\u3070\u3001\u8868\u9762\u4e0a\u306f ReadOnlyCollection \u3068\u3057\u3066\u6271\u3048\u308b\u3002Add \u30e1\u30bd\u30c3\u30c9\u306a\u3069\u3092\u547c\u3073\u51fa\u3059\u3068\u3001\u5b9f\u884c\u6642\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\uff08\u30e1\u30bd\u30c3\u30c9\u81ea\u4f53\u3092\u306a\u304f\u3057\u3066\u3057\u307e\u3063\u3066\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u30a8\u30e9\u30fc\u306b\u3059\u308b\u3001\u3063\u3066\u306e\u3067\u3082\u3044\u3044\u304b\u3082\u3057\u308c\u306a\u3044\uff09\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3061\u3087\u3063\u3068\u6c17\u306b\u306a\u3063\u305f\u306e\u3067\u30e1\u30e2\u66f8\u304d C# \u306e Dictonary \u306f referencesource\/mscorlib\/system\/collections\/generic\/dictionary.cs \u306b\u3042\u3063\u3066\u3001bucket &hellip; <a href=\"https:\/\/www.moonmile.net\/blog\/archives\/6691\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-6691","post","type-post","status-publish","format-standard","hentry","category-dev"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/6691","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/comments?post=6691"}],"version-history":[{"count":4,"href":"https:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/6691\/revisions"}],"predecessor-version":[{"id":6697,"href":"https:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/6691\/revisions\/6697"}],"wp:attachment":[{"href":"https:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/media?parent=6691"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/categories?post=6691"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/tags?post=6691"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}