Skip to content

Commit

Permalink
Merge pull request elm#436 from jvoigtlaender/dicts-ordered
Browse files Browse the repository at this point in the history
Documentation: Express order in Dict/Set enumeration functions
  • Loading branch information
process-bot committed Nov 28, 2015
2 parents 624907f + 0a08c2b commit 033fe1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Dict.elm
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ diff t1 t2 =
foldl (\k v t -> remove k t) t1 t2


{-| Get all of the keys in a dictionary.
{-| Get all of the keys in a dictionary, sorted from lowest to highest.
keys (fromList [(0,"Alice"),(1,"Bob")]) == [0,1]
-}
Expand All @@ -549,7 +549,7 @@ keys dict =
foldr (\key value keyList -> key :: keyList) [] dict


{-| Get all of the values in a dictionary.
{-| Get all of the values in a dictionary, in the order of their keys.
values (fromList [(0,"Alice"),(1,"Bob")]) == ["Alice", "Bob"]
-}
Expand All @@ -558,7 +558,7 @@ values dict =
foldr (\key value valueList -> value :: valueList) [] dict


{-| Convert a dictionary into an association list of key-value pairs. -}
{-| Convert a dictionary into an association list of key-value pairs, sorted by keys. -}
toList : Dict comparable v -> List (comparable,v)
toList dict =
foldr (\key value list -> (key,value) :: list) [] dict
Expand Down
2 changes: 1 addition & 1 deletion src/Set.elm
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ diff (Set_elm_builtin d1) (Set_elm_builtin d2) =
Set_elm_builtin <| Dict.diff d1 d2


{-| Convert a set into a list.
{-| Convert a set into a list, sorted from lowest to highest.
-}
toList : Set comparable -> List comparable
toList (Set_elm_builtin d) =
Expand Down

0 comments on commit 033fe1f

Please sign in to comment.