anchor.diff:      | _ ->
           ()
   
  -    Halt
  -
  -let processLine line =
  -    let ifContinueThen func status =
  -        match status with
  -        | Continue s -> func s
  -        | Halt -> Halt
  -
  -    line
  -    |> processCritical
  -    |> ifContinueThen processMessage
  -
  -let rec processMessages (reader:StreamReader) (writer:StreamWriter) = async {
  +    Result state
  +
  +let processMessage (line:string) state =
  +    if line.StartsWith "PING " then
  +        let writer = state.stream
  +        writer.WriteLine ("PONG " + line.Substring("PING ".Length))
  +        writer.Flush()
  +        state
  +    else
  +        let ifContinueThen func status =
  +            match status with
  +            | Continue s -> func s
  +            | Result x -> Result x
  +            | Halt -> Halt
  +
  +        let getResultOr def status =
  +            match status with
  +            | Result x | Continue x -> x
  +            | Halt -> def
  +
  +        let code =
  +            let split = line.Split ' '
  +            if split.Length > 0 then split.[1] else ""
  +
  +        (code,line,state)
  +        |> processImportant
  +        |> ifContinueThen processNormal
  +        |> getResultOr state
  +
  +let rec processMessages (reader:StreamReader) state = async {
       let line = reader.ReadLine()
   
       if line <> null then
  -        if line.Length > 0 then
  -            if line.StartsWith "PING " then
  -                writer.WriteLine ("PONG " + line.Substring("PING ".Length))
  -                writer.Flush()
  -            else
  -                processLine line |> ignore
  -
  -        return! processMessages reader writer
  +        let newState = processMessage line state
  +        return! processMessages reader newState
       else
           ()
   }
  
positive.code:     cprintf ConsoleColor.Magenta "%s " status
      printfn ""
  
  type PipeStatus<'a> =
      | Continue of 'a
      | Halt
  
  let processCritical (line:string) =
      let code =
          let split = line.Split ' '
          if split.Length > 0 then split.[1] else ""
  
      match code with
      | "004" ->
          println "Logged in"
  
negative.code:         else
              printTime()
              cprintf ConsoleColor.Cyan " <%s> " (getChannel())
  
              if state.mods |> List.exists (fun s -> s = username) then
                  cprintf ConsoleColor.Gray "[M] "
  
              cprintf ConsoleColor.Yellow "%s" username
              cprintf ConsoleColor.White ": %s" (getMessage())
              printfn ""
  