We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2a72fdc commit 87f5d73Copy full SHA for 87f5d73
src/Data/DHT/Type/Handle.hs
@@ -53,7 +53,14 @@ instance Show DhtHandle where
53
-- | Low-level DHT handle that is used by DHT implementations, but not consumers.
54
data DhtHandle' s h = DhtHandle'
55
{ state :: !s
56
+ -- ^ Internal state of the DHT implementation.
57
+
58
, hash :: !(s -> DhtKey -> h)
59
+ -- ^ Having hash function being part of the interface allows implementation
60
+ -- to decide where the hashing function is evaluated. In example, having
61
+ -- @hash = const id@ will force @h = DhtKey@, and DHT implementation will
62
+ -- be handling the hashing.
63
64
, join :: !(s -> DhtResult IO ())
65
, leave :: !(s -> DhtResult IO ())
66
, lookup :: !(s -> h -> DhtResult IO Encoding)
0 commit comments