equal
deleted
inserted
replaced
40 r <- atomically $ (Left `fmap` readTChan acceptChan) `orElse` (Right `fmap` tselect clients) |
40 r <- atomically $ (Left `fmap` readTChan acceptChan) `orElse` (Right `fmap` tselect clients) |
41 case r of |
41 case r of |
42 Left ci -> do |
42 Left ci -> do |
43 mainLoop servSock acceptChan (ci:clients) rooms |
43 mainLoop servSock acceptChan (ci:clients) rooms |
44 Right (cmd, client) -> do |
44 Right (cmd, client) -> do |
45 print ("> " ++ show cmd) |
45 putStrLn ("> " ++ show cmd) |
46 let (clientsFunc, roomsFunc, handlesFunc, answer) = handleCmd client clients rooms $ cmd |
46 let (clientsFunc, roomsFunc, handlesFunc, answer) = handleCmd client clients rooms $ cmd |
47 print ("< " ++ show answer) |
47 putStrLn ("< " ++ show answer) |
48 |
48 |
49 let mclients = clientsFunc clients |
49 let mclients = clientsFunc clients |
50 let mrooms = roomsFunc rooms |
50 let mrooms = roomsFunc rooms |
51 let recipients = handlesFunc client clients rooms |
51 let recipients = handlesFunc client clients rooms |
52 |
52 |