Repository navigation
|
Suppose you have a method This approach is rather non-functional and not in the style of LanguageExt. Is there a more functional version that someone can recommend? |
Replies: 3 comments 5 replies
|
|
public Fin<Unit> Process(IEnumerable<string> inputValues) =>
inputValues.Sequence(Calc).Map(_ => unit);
public Fin<Unit> Process(IEnumerable<string> inputValues) =>
inputValues.Map(Calc).Traverse(identity).Map(_ => unit);To get back to a As you can see from above, It's always worth remembering that There are literally 100s of hand written There's also |
|
Hm, I don't get it to work with I get it to work with In this example |

Pretty sure all of this is covered with the previous replies. Did you try them?
But using your example, with some added
Console.WriteLinelogging, you can see it implemented (as in the previous reply) usingSequenceandTraverse.Sequencebeing slightly more concise.