Skip to content

Commit

Permalink
Add docs for Map and Set libraries.
Browse files Browse the repository at this point in the history
  • Loading branch information
process-bot committed Oct 10, 2012
1 parent 905ddd8 commit c4fd35c
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions public/Documentation.elm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ standard = ("General Purpose",
[ ("Data.Char", "docs/Data/Char.elm")
, ("Data.Maybe", "docs/Data/Maybe.elm")
, ("Data.List", "docs/Data/List.elm")
, ("Data.Map", "docs/Data/Map.elm")
, ("Data.Set", "docs/Data/Set.elm")
, ("Prelude", "docs/Prelude.elm")
])

Expand Down
17 changes: 17 additions & 0 deletions public/docs/Data/Map.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

import Website.Docs (createDocs)

basics =
[ ("empty", "Map k v", "Create an empty map.")
, ("singleton", "k -> v -> Map k v", "Create a map with one key-value pair.")
, ("insert", "k -> v -> Map k v -> Map k v", "Insert a key-value pair into a map. Replaces value when there is a collision.")
, ("lookup", "k -> Map k v -> Maybe v", "Lookup the value associated with a key.")
, ("remove", "k -> Map k v -> Map k v", "Remove a key-value pair from a map. If the key is not found, no changes are made.")
, ("member", "k -> Map k v -> Bool", "Determine if a key is in a map.")
-- , ("keys", "Map k v -> [k]", "Get all of the keys in a map.")
-- , ("values", "Map k v -> [v]", "Get all of the values in a map.")
]

categories = [ ("Using Maps", basics) ]

main = createDocs "Data.Map" categories
14 changes: 14 additions & 0 deletions public/docs/Data/Set.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

import Website.Docs (createDocs)

basics =
[ ("empty", "Set a", "Create an empty set.")
, ("singleton", "a -> Set a", "Create a set with one value.")
, ("insert", "a -> Set a -> Set a", "Insert a value into a set.")
, ("remove", "a -> Set a -> Set a", "Remove a value from a set. If the value is not found, no changes are made.")
, ("member", "a -> Set a -> Bool", "Determine if a value is in a set.")
]

categories = [ ("Using Sets", basics) ]

main = createDocs "Data.Set" categories

0 comments on commit c4fd35c

Please sign in to comment.