Dict module

The gleam/dict standard library module defines Gleam's Dict type and functions for working with it. A dict is a collection of keys and values which other languages may call a hashmap or table.

gleam/dict 標準ライブラリモジュールは、Gleam の Dict 型とそれを扱う関数を定義しています。辞書(dict)はキーと値のコレクションで、他の言語ではハッシュマップやテーブルと呼ばれることもあります。

new and from_list can be used to create new dicts.

newfrom_list は、新しい辞書を作成するために使われます。

insert and delete are used to add and remove items from a dict.

insertdelete は、辞書に項目を追加したり削除したりするために使われます。

Like lists, dicts are immutable. Inserting or deleting an item from a dict will return a new dict with the item added or removed.

リストと同様に辞書は不変(イミュータブル)です。dict にアイテムを挿入したり削除したりすると、その項目が追加または削除された新しい辞書が返されます。

Dicts are unordered! If it appears that the items in a dict are in a certain order this is incidental and should not be relied upon. Any ordering may change without warning in future versions or on different runtimes.

辞書は順序付けられていません!辞書のアイテムがある順序で並んでいる様に見えても、それは偶発的なものであり、その順序に依存してはいけません。将来のバージョンや異なるランタイムでは、警告なしに異なる順序でアイテムが参照される可能性があります。

辞書のキーには文字列以外も指定できますが、リストと同様に辞書のアイテムは全てが同じ型のキーと値である必要があります。