applyDeletedToRemote :: Map Path RemoteFile -> File -> ApiAction Change
applyDeletedToRemote remoteFiles file = do
    let deletedPath = File.path file
    let remoteFileMaybe = Map.lookup deletedPath remoteFiles
    case remoteFileMaybe of
        Just remoteFile -> do
            deleteRemote remoteFile
            return $ Deleted (getFile remoteFile)
        Nothing -> error $ "remote file not found: " ++ show deletedPath
applyDeletedToRemote :: Map Path RemoteFile -> File -> ApiAction Change
applyDeletedToRemote remoteFiles file = do
    let deletedPath = File.path file
    let remoteFileMaybe = Map.lookup deletedPath remoteFiles
    case remoteFileMaybe of
        Just remoteFile -> do
            deleteRemote remoteFile
            return $ Deleted (getFile remoteFile)
        Nothing -> error $ "remote file not found: " ++ show deletedPath
applyDeletedToRemote remoteFiles file = do
    let deletedPath = File.path file
    let remoteFileMaybe = Map.lookup deletedPath remoteFiles
    case remoteFileMaybe of
        Just remoteFile -> do
            deleteRemote remoteFile
            return $ Deleted (getFile remoteFile)
        Nothing -> error $ "remote file not found: " ++ show deletedPath