Esempio n. 1
0
 private Result <HashSet <string> > ReadWords(string path, ReaderFinder readerFinder)
 {
     return(File.Exists(path)
            .AsResult()
            .FailIf(e => !e, $"Файла {path} не существует")
            .Then(e => readerFinder.Find(path))
            .Then(reader => reader.ReadWords(path))
            .Then(words => words.ToHashSet())
            .OnFail(HandleError));
 }