News for hackers. Stuff that matters.
Re:Why it’s hard for programmers to write a program to flatt... by contravariant on Friday February 24, 2017 @01:27PM (#13726220)
Like others have pointed out you should have used recursion. Although, if you really wanted to you can make one similar to yours that doesn't (explicitely) use recursion. That results in the following:

    flatten = (lambda f: lambda *args: 
     (lambda x: lambda *args2: f(x(x))(*args2))
     (lambda x: lambda *args2: f(x(x))(*args2))(*args))(
        lambda f: lambda l: [item for sublist in l for item in f(sublist)] if isIterable(l) else [l]
    )

There are no comments on this comment yet.