4 ms·
I am used to haskell's syntax, does this become more readable once you get used to it? The haskell equivalent would be [x | x <- s, p x]
by Tarean 8y ago
I am used to haskell's syntax, does this become more readable once you get used to it? The haskell equivalent would be
[x | x <- s, p x]
- roenxi 8y agoIn many senses this is a style thing, but: There is going to be a pretty sharp break between people who accept that working with a collection deserves special syntax support and those who don't. The readability issue for me isn't that the syntax doesn't look nice, it is that I've invested years into making a very efficient little mental space that deals with "data2 = fn(data1)" style constructs and I want to use it here like I do everywhere else. Some silly-high percentage of for loops can be cast into this data2 = fn(data1). Why am I being told that it isn't readable? If this isn't easy to read, then something is wrong with the function syntax. A chaining operator, to recast fn3(fn2(fn1(data))) => data > fn1 > fn2 > fn3 with reduce is much more readable, debuggable and easy to reason about than having to remember what syntax todays language uses to talk about collections and how that works in to the flow of data in my program.