-parseMessages :: MessageParser a -> [FromServerMessage] -> Either ParseError a
-parseMessages parser = runP parser MessageParserState ""
\ No newline at end of file
+instance Stream (Chan a) IO a where
+ uncons c = do
+ x <- readChan c
+ return $ Just (x, c)
+
+test :: IO ()
+test = do
+ chan <- newChan
+ let parser = do
+ n <- count 2 notification
+ rsp <- response
+ return (n, rsp)
+ forkIO $ forM_ [testLog, testLog, testSymbols] $ \x -> do
+ writeChan chan x
+ threadDelay 1000000
+ x <- runParserT parser MessageParserState "" chan
+ print x
\ No newline at end of file