@@ -8,7 +8,7 @@ introductory documentation for @containers@ at
88<https://haskell-containers.readthedocs.io>.
99
1010@
11- data HashSet element = ...
11+ data ' HashSet' element = ...
1212@
1313
1414
@@ -17,8 +17,8 @@ functions do not modify the set that you passed in, they creates a new set. In
1717order to keep the changes you need to assign it to a new variable. For example:
1818
1919@
20- let s1 = HashSet.fromList ["a", "b"]
21- let s2 = HashSet.delete "a" s1
20+ let s1 = ' HashSet.fromList' ["a", "b"]
21+ let s2 = ' HashSet.delete' "a" s1
2222print s1
2323> fromList ["a","b"]
2424print s2
@@ -41,42 +41,43 @@ module Tutorial.HashSet (
4141
4242 ) where
4343
44+ import qualified Data.HashSet as HashSet
4445
4546{- $shortexample
4647
4748The following GHCi session shows some of the basic set functionality:
4849
4950@
50- import qualified Data.HashSet as HashSet
51+ import qualified ' Data.HashSet' as HashSet
5152
52- let dataStructures = HashSet.fromList ["HashSet", "HashMap", "Graph"]
53+ let dataStructures = ' HashSet.fromList' ["HashSet", "HashMap", "Graph"]
5354
5455-- Check if "HashMap" and "Trie" are in the set of data structures.
55- HashSet.member "HashMap" dataStructures
56+ ' HashSet.member' "HashMap" dataStructures
5657> True
5758
58- HashSet.member "Trie" dataStructures
59+ ' HashSet.member' "Trie" dataStructures
5960> False
6061
6162
6263-- Add "Trie" to our original set of data structures.
6364let moreDataStructures = HashSet.insert "Trie" dataStructures
6465
65- HashSet.member "Trie" moreDataStructures
66+ ' HashSet.member' "Trie" moreDataStructures
6667> True
6768
6869
6970-- Remove "Graph" from our original set of data structures.
7071let fewerDataStructures = HashSet.delete "Graph" dataStructures
7172
72- HashSet.toList fewerDataStructures
73+ ' HashSet.toList' fewerDataStructures
7374> ["HashSet", "HashMap"]
7475
7576
7677-- Create a new set and combine it with our original set.
7778let orderedDataStructures = HashSet.fromList ["Set", "Map"]
7879
79- HashSet.union dataStructures orderedDataStructures
80+ ' HashSet.union' dataStructures orderedDataStructures
8081> fromList ["Map", "HashSet", "Graph", "HashMap", "Set"]
8182@
8283
0 commit comments