News for hackers. Stuff that matters.
Re:How to stop functional programming by falcolas on Tuesday February 23, 2016 @06:39PM (#11163292)
I would agree, but have a look at this:

http://reactivex.io/documentation/operators/flatmap.html

Granted, this refers to a higher level abstraction on a sequence of realtime events, but as we delve more into green threads and lazy evaluation, these kinds of solutions will become more common.

I really don't believe that there is no obvious way to guarantee the ordering of a given flatten command without looking into its implementation. Of course, I'm admittedly partial to Python's solution - use an explicit list comprehension:

    >>> g = lambda i: (i, -i)
    >>> [x for y in [1, 2, 3] for x in g(y)]
    [1, -1, 2, -2, 3, -3]

There are no comments on this comment yet.