refreshClient :: Connection -> Client -> IO Client
refreshClient conn client = do
    let q = "select nickname, lat, lng, room_id from clients where client_id = ?" 
    xs@((nickname, mlat, mlng, mrid):_) :: [(Text, Maybe Double, Maybe Double, Maybe Int)] <- query conn q (Only $ clientId client)
    let latLng = case (mlat,mlng) of 
                   (Just lat, Just lng) -> Just (lat, lng)
                   otherwise -> Nothing
    return (client {nickName = nickname, clientRoomId = mrid})

--- this is too much implementation detail
refreshClient :: Connection -> Client -> IO Client
refreshClient conn client = do
    let q = "select nickname, lat, lng, room_id from clients where client_id = ?" 
    xs@((nickname, mlat, mlng, mrid):_) :: [(Text, Maybe Double, Maybe Double, Maybe Int)] <- query conn q (Only $ clientId client)
    let latLng = case (mlat,mlng) of 
                   (Just lat, Just lng) -> Just (lat, lng)
                   otherwise -> Nothing
    return (client {nickName = nickname, clientRoomId = mrid})

--- this is too much implementation detail
refreshClient conn client = do
    let q = "select nickname, lat, lng, room_id from clients where client_id = ?" 
    xs@((nickname, mlat, mlng, mrid):_) :: [(Text, Maybe Double, Maybe Double, Maybe Int)] <- query conn q (Only $ clientId client)
    let latLng = case (mlat,mlng) of 
                   (Just lat, Just lng) -> Just (lat, lng)
                   otherwise -> Nothing
    return (client {nickName = nickname, clientRoomId = mrid})

--- this is too much implementation detail