git.iko.soy/distributed-process
on master help sign in
Support network-2.4.0
8f51d80Edsko de Vries
distributed-process-simplelocalnet/distributed-process-simplelocalnet.cabal+2−1
@@ -38,7 +38,8 @@ Library
38 Exposed-modules: Control.Distributed.Process.Backend.SimpleLocalnet,
38 Exposed-modules: Control.Distributed.Process.Backend.SimpleLocalnet,
39 Control.Distributed.Process.Backend.SimpleLocalnet.Internal.Multicast
39 Control.Distributed.Process.Backend.SimpleLocalnet.Internal.Multicast
40 Extensions: RankNTypes,
40 Extensions: RankNTypes,
41− DeriveDataTypeable
41+ DeriveDataTypeable,
42+ CPP
42 ghc-options: -Wall
43 ghc-options: -Wall
43 HS-Source-Dirs: src
44 HS-Source-Dirs: src
44
45
distributed-process-simplelocalnet/src/Control/Distributed/Process/Backend/SimpleLocalnet/Internal/Multicast.hs+4−2
@@ -61,10 +61,12 @@ initMulticast host port bufferSize = do
61
61
62type UDPState = Map SockAddr BSL.ByteString
62type UDPState = Map SockAddr BSL.ByteString
63
63
64−-- TODO: This is inefficient and an orphan instance.
64+#if MIN_VERSION_network(2,4,0)
65−-- Requested official instance (https://github.com/haskell/network/issues/38)
65+-- network-2.4.0 provides the Ord instance for us
66+#else
66instance Ord SockAddr where
67instance Ord SockAddr where
67 compare = compare `on` show
68 compare = compare `on` show
69+#endif
68
70
69bufferFor :: SockAddr -> Accessor UDPState BSL.ByteString
71bufferFor :: SockAddr -> Accessor UDPState BSL.ByteString
70bufferFor = DAC.mapDefault BSL.empty
72bufferFor = DAC.mapDefault BSL.empty