Skip to content

Commit a331c1c

Browse files
committed
Formatting fixes in tutorial modules.
1 parent 522fc41 commit a331c1c

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

Tutorial.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,21 @@ more examples or tutorials you should check out:
5050
-}
5151

5252
{- $installing
53-
__Version Requirements__
53+
==Version Requirements
5454
5555
All of the examples here should work for all recent versions of the package.
5656
57-
__Importing modules__
57+
==Importing modules
5858
5959
All of the modules in @unordered-containers@@ should be imported @qualified@
6060
since they use names that conflict with the standard Prelude.
6161
6262
@
63-
import qualified Data.HashSet as HashSet
64-
import qualified Data.HashMap.Strict as HashMap
63+
import qualified 'Data.HashSet' as HashSet
64+
import qualified 'Data.HashMap.Strict' as HashMap
6565
@
6666
67-
__In GHCi__
67+
==In GHCi
6868
6969
Start the GHCi
7070
<https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop REPL> with

Tutorial/HashSet.hs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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
1717
order 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
2222
print s1
2323
> fromList ["a","b"]
2424
print s2
@@ -41,42 +41,43 @@ module Tutorial.HashSet (
4141

4242
) where
4343

44+
import qualified Data.HashSet as HashSet
4445

4546
{- $shortexample
4647
4748
The 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.
6364
let 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.
7071
let 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.
7778
let 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

Comments
 (0)