-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathTutorial.hs
More file actions
89 lines (62 loc) · 2.5 KB
/
Copy pathTutorial.hs
File metadata and controls
89 lines (62 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-|
The @unordered-containers@ package provides implementations of various
hash-based immutable data structures.
Some of the data structures provided by this package have a very large API
surface (for better or worse). The docs here focus on the most common functions
which should be more than enough to get you started. Once you know the basics,
or if you're looking for a specific function, you can head over to the
full API documentation!
-}
module Tutorial (
-- * Provided Data Structures
-- $provideddatastructures
-- * Related Packages
-- $relatedpackages
-- * Looking for more resources?
-- $moreresources
-- * Installing and using the @unordered-containers@ packages #installing#
-- ** Version Requirements
-- $versionreqs
-- ** Importing modules
-- $importingmodules
-- ** In GHCi
-- $ghci
-- * HashSet and HashMap tutorial
-- $tutorials
) where
{- $provideddatastructures
* "Data.HashSet" - unordered, non-duplicated elements
* '"Data.HashMap" - unordered map from keys to values (aka. dictionaries)
-}
{- $relatedpackages
* <https://hackage.haskell.org/packages/containers containers> - ordered containers using trees instead of hashing.
* <https://hackage.haskell.org/packages/hashable containers> - types that can be converted to a hash value.
-}
{- $moreresources
If you've worked your way through the documentation here and you're looking for
more examples or tutorials you should check out:
* <https://haskell-lang.org/library/containers haskell-lang.org's containers tutorial>, its focused on the ordered
<https://hackage.haskell.org/packages/containers containers> library but provides some useful examples.
* <http://learnyouahaskell.com/modules Learn You a Haskell "Modules" chapter>
-}
{- $versionreqs
All of the examples here should work for all recent versions of the package.
-}
{- $importingmodules
All of the modules in @unordered-containers@@ should be imported @qualified@
since they use names that conflict with the standard Prelude.
@
import qualified "Data.HashSet" as HashSet
import qualified "Data.HashMap.Strict" as HashMap
@
-}
{- $ghci
Start the GHCi
<https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop REPL> with
@ghci@, @cabal repl@, or @stack ghci@. Once the REPL is loaded, import the
modules you want using the @import@ statements above and you're good to go!
-}
{- $tutorials
See "Tutorial.HashSet" and "Tutorial.HashMap".
-}