-- | Read an IRC message string.

hGetIRCLine :: Handle -> IO MsgString
hGetIRCLine h = getl B.empty
  where
    getl :: MsgString -> IO MsgString
    getl buf = do
      c <- hGetChar h
      if isIRCEOLChar c
        then return buf
        else getl (B.snoc buf c)


-- | Read the next valid IRC message.
hGetIRCLine :: Handle -> IO MsgString
hGetIRCLine h = getl B.empty
  where
    getl :: MsgString -> IO MsgString
    getl buf = do
      c <- hGetChar h
      if isIRCEOLChar c
        then return buf
        else getl (B.snoc buf c)


-- | Read the next valid IRC message.
hGetIRCLine h = getl B.empty
  where
    getl :: MsgString -> IO MsgString
    getl buf = do
      c <- hGetChar h
      if isIRCEOLChar c
        then return buf
        else getl (B.snoc buf c)


-- | Read the next valid IRC message.