Are there any differences between Select and Map? if not why include Map in this library #922
-
Hi I cant see any difference between Select and Map Implementation when reading the docs? Why include Map? I think it adds more confusion when we already have Select Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
This is not my library so maybe the following answer is a guess. But from what I learned by using the library and sometimes diving into details, the main reason is probably that map, filter, bind, fold etc are common names for those FP operations outside of C#. As a lot of concepts in LanguageExt try to bring FP into "C# world" this makes it a lot easier to understand concepts and to communicate with others. Probably the name choice in C# (select, where, selectmany, aggregate) was unfortunate from today's FP perspective -- it was heavily inspired by SQL terminology. But that's history. For practical reasons LanguageExt types supports C# select, where ...., too. This enables LINQ style -- which is a good fit here, because LINQ is a very functional (FP) concept in C# and it is very useful with LanguageExt. There might be more technical reasons because of implementation differences between |
Beta Was this translation helpful? Give feedback.
-
I kind of thought that would be the case but it does make the landscape a whole lot more confusing lol |
Beta Was this translation helpful? Give feedback.
-
@StefanBertels is correct, |
Beta Was this translation helpful? Give feedback.
This is not my library so maybe the following answer is a guess.
But from what I learned by using the library and sometimes diving into details, the main reason is probably that map, filter, bind, fold etc are common names for those FP operations outside of C#. As a lot of concepts in LanguageExt try to bring FP into "C# world" this makes it a lot easier to understand concepts and to communicate with others.
Probably the name choice in C# (select, where, selectmany, aggregate) was unfortunate from today's FP perspective -- it was heavily inspired by SQL terminology. But that's history.
For practical reasons LanguageExt types supports C# select, where ...., too. This enables LINQ style -- …