findRoom :: Connection -> RoomId -> IO Room
findRoom conn rid = do
    let q = "select rooms.lat, rooms.lng from rooms where room_id = ?"
    xs@((lat, lng):_) :: [(Double, Double)] <- query conn q (Only rid)
    let q2 = "select client_id, nickname from clients where room_id = ?"
    clients :: [(Int, Text)]  <- query conn q2 (Only rid)
    return (Room { roomId = rid
                 , latLng = (lat, lng)
                 , numParticipants = (length clients)
                 , clients = clients
                 })

-- tuple client
findRoom :: Connection -> RoomId -> IO Room
findRoom conn rid = do
    let q = "select rooms.lat, rooms.lng from rooms where room_id = ?"
    xs@((lat, lng):_) :: [(Double, Double)] <- query conn q (Only rid)
    let q2 = "select client_id, nickname from clients where room_id = ?"
    clients :: [(Int, Text)]  <- query conn q2 (Only rid)
    return (Room { roomId = rid
                 , latLng = (lat, lng)
                 , numParticipants = (length clients)
                 , clients = clients
                 })

-- tuple client
findRoom conn rid = do
    let q = "select rooms.lat, rooms.lng from rooms where room_id = ?"
    xs@((lat, lng):_) :: [(Double, Double)] <- query conn q (Only rid)
    let q2 = "select client_id, nickname from clients where room_id = ?"
    clients :: [(Int, Text)]  <- query conn q2 (Only rid)
    return (Room { roomId = rid
                 , latLng = (lat, lng)
                 , numParticipants = (length clients)
                 , clients = clients
                 })

-- tuple client