getNameErrors :: Bool -> FsEntry -> [String]
getNameErrors isRoot node = validMsg ++ absoluteMsg
  where
    validMsg    = [validErr | not . isValid $ filePath]
    absoluteMsg = [absErr   | not isRoot && isAbsolute filePath]
    filePath    = _entryNameName . _entryName $ node
    validErr    = "Invalid name: '" ++ filePath ++ "'"
    absErr      = "Absolute path: '" ++ filePath ++ "'"

-- Check the integrity of a given file system, collecting errors recursively.
getNameErrors :: Bool -> FsEntry -> [String]
getNameErrors isRoot node = validMsg ++ absoluteMsg
  where
    validMsg    = [validErr | not . isValid $ filePath]
    absoluteMsg = [absErr   | not isRoot && isAbsolute filePath]
    filePath    = _entryNameName . _entryName $ node
    validErr    = "Invalid name: '" ++ filePath ++ "'"
    absErr      = "Absolute path: '" ++ filePath ++ "'"

-- Check the integrity of a given file system, collecting errors recursively.
getNameErrors isRoot node = validMsg ++ absoluteMsg
  where
    validMsg    = [validErr | not . isValid $ filePath]
    absoluteMsg = [absErr   | not isRoot && isAbsolute filePath]
    filePath    = _entryNameName . _entryName $ node
    validErr    = "Invalid name: '" ++ filePath ++ "'"
    absErr      = "Absolute path: '" ++ filePath ++ "'"

-- Check the integrity of a given file system, collecting errors recursively.