3-+     % takes produces a structure around a  to D | handle multiple callers to the serial port. The return value is B | the channel to which all commands will flow. Users should use  | the , function to access it instead of trying to  | access its details directly. the handle to wrap ;the termination string for commands received from the port 4the termination string for command send to the port OHaving multiple serial managers running on the same port is a disaster waiting  to happen. When you're done with a , run  on  it to shut it down. All the commands to operate a  should be  specializations of  , created by applying it to the E first three arguments, then using that thereafter as the command to  the serial port. AFor example, the Olympus IX-81 requires a login command from the  user (2LOG IN) followed by rn as an end of line. The  response will be 2LOG + followed by r. So a login command  would look like   p = ("2LOG" `isPrefixOf`)  , login mgr = wrapCommand "\r\n" "2LOG IN" p  uses functions of type 'String -> Bool' users can choose D whether or not to match any given command based upon its contents, < rather than just blindly saying whether it matches or not. The command to send /The predicate to recognize the returning value The serial port to access The response from the port Sometimes we don'2t want the current thread to block, but we still G want some action when the a command returns from the serial port. To  that end, ! lets us pass a function of type  'String -> IO ()'. to be executed when a response is recognized  by the predicate. The command to send /The predicate to recognize the returning value -The callback to run when the command returns The serial port to access 0The thread id in which the command is being run  Serial8 lets the user set the number of stop bits, the parity, > flow control (there is no hardware flow control, since it isn't  supported in the System.Posix.IO library), number of bits per < byte, and the baud rate. The baud rate is declared by the   in System.Posix.Terminal.  ,  , and   are defined here. 5 opens the serial port and sets the options the user C passes, makes its buffering line oriented, and returns the handle C to control it. For example, an Olympus IX-81 microscope attached 8 to the first serial port on Linux would be opened with 4 openSerial "/dev/ttyS0" B19200 8 One Even Software )The filename of the serial port, such as devttyS0 )The number of bits per word, typically 8 Almost always One unless you're talking to a printer  !o"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~             !"#$%&' !( !) !* !+ !, !- !. !/ !0 !1 !2 !3 !4 !5 !6 !7 !8 !9 !: !; !< != !> !? !@ !A !B !C !D !E !F !G !H !I !J !K !L !M !N !O !P !Q !R !S !T !U !V !W !X !Y !Z ![ !\ !] !^ !_ !` !a !b !c !d !e !f !g !h !i !j !k !l !m !n !o !p !q !r !s !t !u !v !w !x !y !z !{ !| !} !~ ! ! ! ! ! ! ! ! ! ! ! ! serial-0.2.5System.Serial.Manager System.Serial SerialManager SerialCommand serialManagercloseSerialManager wrapCommandwrapCommandWithCallback FlowControl NoFlowControlSoftwareParityNoParityOddEvenStopBitsTwoOne openSerial managedHandlestorageinputTerminatoroutputTerminatorportMonitorThreadbaseGHC.IO.Handle.TypesHandleprocess isolateWhere portWatcher takeUntil unix-2.4.0.2System.Posix.TerminalBaudRate setSerial withParitywithFlowControl withStopBitsconfigureSettingsopenPseudoTerminalgetSlaveTerminalNamegetControllingTerminalNamegetTerminalName queryTerminalsetTerminalProcessGroupIDgetTerminalProcessGroupID controlFlow discardData drainOutput sendBreaksetTerminalAttributesgetTerminalAttributeswithOutputSpeed outputSpeedwithInputSpeed inputSpeed withMinInputminInputwithTime inputTime withoutCCwithCC controlCharwithBits bitsPerByte terminalModewithMode withoutModeTerminalAttributesInterruptOnBreak MapCRtoLF IgnoreBreakIgnoreCRIgnoreParityErrors MapLFtoCR CheckParity StripHighBitStartStopInputStartStopOutputMarkParityErrors ProcessOutput LocalMode ReadEnable TwoStopBits HangupOnClose EnableParity OddParity EnableEcho EchoEraseEchoKillEchoLF ProcessInputExtendedFunctionsKeyboardInterruptsNoFlushOnInterruptBackgroundWriteInterrupt TerminalMode EndOfFile EndOfLineErase InterruptKillQuitStartStopSuspendControlCharacterB0B50B75B110B134B150B200B300B600B1200B1800B2400B4800B9600B19200B38400B57600B115200 Immediately WhenDrained WhenFlushed TerminalState InputQueue OutputQueue BothQueues QueueSelector SuspendOutput RestartOutput TransmitStop TransmitStart FlowAction