equal
deleted
inserted
replaced
14 moveClientToLobby, |
14 moveClientToLobby, |
15 moveClientToRoom, |
15 moveClientToRoom, |
16 clientRoom, |
16 clientRoom, |
17 clientRoomM, |
17 clientRoomM, |
18 client, |
18 client, |
|
19 clientsM, |
19 allClients, |
20 allClients, |
20 withRoomsAndClients, |
21 withRoomsAndClients, |
21 showRooms, |
22 showRooms, |
22 roomClients |
23 roomClients |
23 ) where |
24 ) where |
133 |
134 |
134 |
135 |
135 clientRoomM :: MRoomsAndClients r c -> ClientIndex -> IO RoomIndex |
136 clientRoomM :: MRoomsAndClients r c -> ClientIndex -> IO RoomIndex |
136 clientRoomM (MRoomsAndClients (_, clients)) (ClientIndex ci) = liftM clientRoom' (clients `readElem` ci) |
137 clientRoomM (MRoomsAndClients (_, clients)) (ClientIndex ci) = liftM clientRoom' (clients `readElem` ci) |
137 |
138 |
|
139 clientsM :: MRoomsAndClients r c -> (c -> a) -> ClientIndex -> IO a |
|
140 clientsM (MRoomsAndClients (_, clients)) f (ClientIndex ci) = liftM (f . client') (clients `readElem` ci) |
|
141 |
138 |
142 |
139 withRoomsAndClients :: MRoomsAndClients r c -> (IRoomsAndClients r c -> a) -> IO a |
143 withRoomsAndClients :: MRoomsAndClients r c -> (IRoomsAndClients r c -> a) -> IO a |
140 withRoomsAndClients (MRoomsAndClients (rooms, clients)) f = |
144 withRoomsAndClients (MRoomsAndClients (rooms, clients)) f = |
141 withIStore2 rooms clients (\r c -> f $ IRoomsAndClients (r, c)) |
145 withIStore2 rooms clients (\r c -> f $ IRoomsAndClients (r, c)) |
142 |
146 |