git.iko.soy/distributed-process
on master help sign in
Support network-2.4.0
commit8f51d801a4592a1923107d4ce9b31829cc2f8c63 authorEdsko de Vries <edsko@edsko.net> dateFri 28 Sep 2012, 14:12 (14 years ago) parenta307db2
2 files changed+6−3
distributed-process-simplelocalnet/distributed-process-simplelocalnet.cabal+2−1 distributed-process-simplelocalnet/src/Control/Distributed/Process/Backend/SimpleLocalnet/Internal/Multicast.hs+4−2
distributed-process-simplelocalnet/distributed-process-simplelocalnet.cabal+2−1
@@ -38,7 +38,8 @@ Library
3838 Exposed-modules: Control.Distributed.Process.Backend.SimpleLocalnet,
3939 Control.Distributed.Process.Backend.SimpleLocalnet.Internal.Multicast
4040 Extensions: RankNTypes,
41− DeriveDataTypeable
41+ DeriveDataTypeable,
42+ CPP
4243 ghc-options: -Wall
4344 HS-Source-Dirs: src
4445
distributed-process-simplelocalnet/src/Control/Distributed/Process/Backend/SimpleLocalnet/Internal/Multicast.hs+4−2
@@ -61,10 +61,12 @@ initMulticast host port bufferSize = do
6161
6262type UDPState = Map SockAddr BSL.ByteString
6363
64−-- TODO: This is inefficient and an orphan instance.
65−-- Requested official instance (https://github.com/haskell/network/issues/38)
64+#if MIN_VERSION_network(2,4,0)
65+-- network-2.4.0 provides the Ord instance for us
66+#else
6667instance Ord SockAddr where
6768 compare = compare `on` show
69+#endif
6870
6971bufferFor :: SockAddr -> Accessor UDPState BSL.ByteString
7072bufferFor = DAC.mapDefault BSL.empty