aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gleam/dict.gleam13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gleam/dict.gleam b/src/gleam/dict.gleam
index 4b0f333..8b459ec 100644
--- a/src/gleam/dict.gleam
+++ b/src/gleam/dict.gleam
@@ -42,14 +42,19 @@ pub fn size(dict: Dict(k, v)) -> Int
///
/// ## Examples
///
+/// Calling `to_list` on an empty `dict` returns an empty list.
+///
/// ```gleam
-/// new()
-/// // -> from_list([])
+/// new() |> to_list
+/// // -> []
/// ```
+///
+/// The ordering of elements in the resulting list is an implementation detail
+/// that should not be relied upon.
///
/// ```gleam
-/// new() |> insert("key", 0)
-/// // -> from_list([#("key", 0)])
+/// new() |> insert("b", 1) |> insert("a", 0) |> insert("c", 2) |> to_list
+/// // -> [#("a", 0), #("b", 1), #("c", 2)]
/// ```
///
@external(erlang, "maps", "to_list")