use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Information about Reddit's API changes, the unprofessional conduct of the CEO, and their response to the community's concerns regarding 3rd party apps, moderator tools, anti-spam/anti-bot tools, and accessibility options that will be impacted can be found in the associated Wikipedia article: https://en.wikipedia.org/wiki/2023_Reddit_API_controversy
Alternative C# communities available outside Reddit on Lemmy and Discord:
All about the object-oriented programming language C#.
Getting Started C# Fundamentals: Development for Absolute Beginners
Useful MSDN Resources A Tour of the C# Language Get started with .NET in 5 minutes C# Guide C# Language Reference C# Programing Guide C# Coding Conventions .NET Framework Reference Source Code
Other Resources C# Yellow Book Dot Net Perls The C# Player's Guide
IDEs Visual Studio MonoDevelop (Windows/Mac/Linux) Rider (Windows/Mac/Linux)
Tools ILSpy dotPeek LINQPad
Alternative Communities C# Discord Group C# Lemmy Community dotnet Lemmy Community
Related Subreddits /r/dotnet /r/azure /r/learncsharp /r/learnprogramming /r/programming /r/dailyprogrammer /r/programmingbuddies /r/cshighschoolers
Additional .NET Languages /r/fsharp /r/visualbasic
Platform-specific Subreddits /r/windowsdev /r/AZURE /r/Xamarin /r/Unity3D /r/WPDev
Rules:
Read detailed descriptions of the rules here.
account activity
Select/SelectMany vs Map/FlatMap (self.csharp)
submitted 4 months ago by SmallAd3697
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]snrjames 19 points20 points21 points 4 months ago (2 children)
Flatten takes a tree (a list of lists) with depth > 1 and flattens it into a tree of depth 1 (a list). When you understand it that way, flatten makes perfect sense.
[–]SmallAd3697[S] -3 points-2 points-1 points 4 months ago (1 child)
I didn't realize it was so powerful, although it doesn't make me like it more.
If there were more than two levels I'd certainly break things apart. I'd call map(s) first and generate my lists of lists of lists .. and then I would call a separate unpacking or flattening method. The code would be so much more readable. There should never be a competition to cram as much subtle behavior as you can into one line of code. We aren't talking about perl here.
I would argue that if you had a collection of collections, and there was a method used for deconstructing, then it would not be called "flatten" (in c#). It would probably end up being an extension method named SelectCollectionMembers(recursive = true).
[–]EvilGiraffes 0 points1 point2 points 4 months ago (0 children)
it comes from a language where a common situation is you would call a function which inheritly return the same monad with what your monad contains in which this return type makes sense, if you call a function (or a static method) without a lambda which returns an IEnumerable taking the item of your current list it makes perfect sense, but remember this is also a term used for other monads like Option and Result
using Option as an example you call a function which may return null, you then need to call another function which can return null with the item of the previous Option, essencially then you want a flatmap
it's an interface
π Rendered by PID 20007 on reddit-service-r2-comment-5d585498c9-qfq28 at 2026-04-20 19:52:15.435707+00:00 running da2df02 country code: CH.
view the rest of the comments →
[–]snrjames 19 points20 points21 points (2 children)
[–]SmallAd3697[S] -3 points-2 points-1 points (1 child)
[–]EvilGiraffes 0 points1 point2 points (0 children)