úÎQëNo%      !"#$ Safe-Infered"The staple for sending a message.  ! is typeclassed so that you can   or  using the same simple syntax.  The CanSend typeclass is not exposed.  Instances of CanSend include %  and Traversable t => t Handle. ! produces an IO action lifted into any &, + so can be used without the extra cruft of '  for most monad stacks. ! is declared as infix 2. Usage:  destination ! someText Send a ( message to exactly one %.  Broadcast a ( message to multiple %s.  Receive a ( message from a %. )* (%&'+)* Safe-Infered"The staple for sending a message.  ! is typeclassed so that you can   or  using the same simple syntax.  The CanSend typeclass is not exposed.  Instances of CanSend include %  and Traversable t => t Handle. ! produces an IO action lifted into any &, + so can be used without the extra cruft of '  for most monad stacks. ! is declared as infix 2. Usage:  destination ! someByteString Send a , message to exactly one %.  Broadcast a , message to multiple %s.  Receive a , message from a %. -.,%&'-. Safe-Infered"The staple for sending a message.  ! is typeclassed so that you can    or   using the same simple syntax.  The  CanSendJson typeclass is not exposed. " Instances of CanSendJson include %  and Traversable t => t Handle. ! produces an IO action lifted into any &, + so can be used without the extra cruft of '  for most monad stacks. ! is declared as infix 2. Usage:   destination ! someData  Anything that is an instance of / can be used  on the right-hand side of !. Derives / and 0 instances 6 for your data types. These are necessary in order to 2 use the functions this module provides with your  custom data types. Usage:    {-# LANGUAGE TemplateHaskell #-} ' data Foo = Bar | Baz { quux :: Int }  $(deriveJson id ''Foo) 2Alteratively, you could write your own instances. #Send a JSON message to exactly one %. %Broadcast a JSON message to multiple %s. Receive a JSON message from a %.  Unlike  and  , the result ( of this MonadIO action is wrapped in a 1.  2 means that the data received 9 could not be parsed from JSON to the correct data type. ? It is up to you to decide whether or not to explicitly handle  the 2 case. ;Notice that this action is polymorphic in its return type. @ Type annotations are usually unnecessary, since type inference ? can usually determine the correct target type. Example usage:    do Just m < - receive h ( case m of Foo x y -> handleFoo x y & Bar z -> handleBar z Here m# is inferred to have whatever type Foo and Bar belong to. = This example code assumes that the JSON parse will succeed.  The 38 function will be invoked for the Monad you are working # in if such a pattern match fails.  45 /0%&'    45 Safe-Infered 1Define the specification of your networking task 8 as a begin, loop, and end proceedure. Run your NetSpec  with $. t indicates the 6 structure used.  []7 is recommended for simplicity, but you are at liberty % to use any Traversable you see fit. s$ indicates the type used for state.  Use () for a stateless specification. 0A server must specify which ports to listen on, = while a client instead specifies tuples of (hostname, port)  to connect to. Indicate whether to Continue or Stop  with a given state Lift a state function into a 7 monad stack "Compose two functions, similar to . from Prelude.  If  h = f .: g then h x y = f (g x y). Continue with a given state Continue (statless) Stop with a given state Stop (stateless) +Conditionally continue with a given state, 7 based on that state and additional given information. Recommended usage: 8 _loop = \handles -> continueIf f .: runStateT $ do ... $Conditionally continue statelessly,  based on given information. Recommended usage / _loop = \handles () -> continueIf_ f $ do ... +Conditionally continue with a given state,  based solely on that state. Recommended usage: : _loop = \handles -> continueIf' f .: execStateT $ do ... !'Conditionally stop with a given state, 7 based on that state and additional given information. "'Conditionally stop with a given state,  based solely on that state. #Conditionally stop statlessly,  based on given information. $Run a  . &Running a spec will step through your 6 9 of connection descriptions, and replace each one with a %, 8 preserving the structure of the Traversable otherwise. 2Regardless of exceptions, all Handles and Sockets : opened by the spec will be closed at the end of the run; > you should not need to close any of the Handles given to you  by the spec. (Note runSpec calls   for you)   !"#$8%9%:;7<=>?@ABC  !"#$ $ !"#  !"#$8D             !"#$%&'()*+)*,-./0-1234/0567568&9:&9;&<=>?&@A)BCD&EFGHIGHJ)BC)BK)BL)BMNOPNOQNORNOSTnetspec-0.2.0.0Network.NetSpec.TextNetwork.NetSpec.ByteStringNetwork.NetSpec.JsonNetwork.NetSpecNetSpecText ByteStringN withSocketsDo!send broadcastreceive deriveJson ClientSpec_conns ServerSpec_ports_begin_loop_end SpecStateStopContinuestateT.:continue continue_stopstop_ continueIf continueIf_ continueIf'stopIfstopIf'stopIf_runSpecbaseGHC.IO.Handle.TypesHandletransformers-0.2.2.0Control.Monad.IO.ClassMonadIOliftIOtext-0.11.1.13Data.Text.Internal $fCanSendf$fCanSendHandle Data.Textpackbytestring-0.9.2.1Data.ByteString.Lazy.Internal aeson-0.6.0.0Data.Aeson.Types.ClassToJSONFromJSON Data.MaybeMaybeNothingGHC.Basefail$fCanSendJsonf$fCanSendJsonHandleData.Traversable TraversableControl.Monad.Trans.State.LazyStateT$fFunctorSpecState Data.Functor<$> mtl-2.0.1.0Control.Monad.State.Classputget runStateT evalStateT execStateTnetwork-2.3.0.11NetworkService PortNumber UnixSocketPortID