processUPatch (Just user@(InternalUser _ _ _ uFiles), fName, patch) =
    case matchFiles uFiles [fName] of
      ApiResponse (Right [content]) -> do
          newFile <- patchFile (File fName content) patch
          return $ success
              (user { iUserFiles = replaceFile uFiles newFile }, newFile)
      ApiResponse (Right _) -> return . failure $ NoSuchFile fName
      ApiResponse (Left err) -> return $ failure err
processUPatch (Just user@(InternalUser _ _ _ uFiles), fName, patch) =
    case matchFiles uFiles [fName] of
      ApiResponse (Right [content]) -> do
          newFile <- patchFile (File fName content) patch
          return $ success
              (user { iUserFiles = replaceFile uFiles newFile }, newFile)
      ApiResponse (Right _) -> return . failure $ NoSuchFile fName
      ApiResponse (Left err) -> return $ failure err
processUPatch (Just user@(InternalUser _ _ _ uFiles), fName, patch) =
    case matchFiles uFiles [fName] of
      ApiResponse (Right [content]) -> do
          newFile <- patchFile (File fName content) patch
          return $ success
              (user { iUserFiles = replaceFile uFiles newFile }, newFile)
      ApiResponse (Right _) -> return . failure $ NoSuchFile fName
      ApiResponse (Left err) -> return $ failure err