Skip to content

Commit 650b5bb

Browse files
committed
Remove specific instructions on making custom types an instance of Hashable and
instead just point out to documentation.
1 parent 1df8f59 commit 650b5bb

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

Data/HashSet.hs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,15 @@ fromList ["Map","HashSet","Graph","HashMap","Set","Sequence"]
6060
6161
=== Using custom data with HashSet
6262
63-
To create a @HashSet@ of your custom type, the type must have instances for 'Eq' and
64-
'Hashable'. The 'Hashable' typeclass is defined in the
65-
<https://hackage.haskell.org/package/hashable hashable> package and the
66-
recommended way to define the instance is using generics, for which you'll need
67-
the @DeriveGeneric@ GHC extension.
68-
69-
Note: You'll need to enable the @DeviceGeneric@ language extension, either via
70-
@:set -XDeriveGeneric@ in GHCi or @\{\-\# DeriveGeneric \#\-\}@ in your Haskell source
71-
code.
63+
To create a @HashSet@ of your custom type, the type must have instances for 'Eq'
64+
and 'Hashable'. The 'Hashable' typeclass is defined in the
65+
<https://hackage.haskell.org/package/hashable hashable> package, see the
66+
documentation for information on how to make your type an instance of
67+
'Hashable'.
7268
7369
We'll start by setting up our custom data type:
7470
71+
>>> :set -XDeriveGeneric
7572
>>> import GHC.Generics (Generic)
7673
>>> import Data.Hashable
7774
>>> data Person = Person { name :: String, likesDogs :: Bool } deriving (Show, Eq, Generic)

0 commit comments

Comments
 (0)