I'm curious, does every else find this<p><pre><code> let persons = names
.map(Person.init)
.filter { $0.isValid }
</code></pre>
easier to read than this?<p><pre><code> var persons: [Person] = []
for name in names {
let person = Person(name: name)
if person.isValid {
persons.append(person)
}
}
</code></pre>
I understand and appreciate the value of compact code, but I find the first one harder to read. A lot of inferred/token based coding is harder for me to mentally parse.
Yo, would be nice to have some functional programming language with decent syntax to program apple machines. Let's call it Dylan to honor the most recent winner of the Nobel prize for literature.<p>Just kidding. The bottomline of this page and talk is that <i>Swift is still not functional.</i> But you can do cool things with it.
The talk discusses how you can incorporate a few functional techniques (map, filter) but the speaker's main goal seems that he wants Swift to be changed to allow for a couple of other functional ideas to be brought into the language.<p>Where's the Swift proposal for the enhancements? Product and Sum support? Algebraic data types?
I enjoyed the talk, thank you.<p>The part about "lifting" a type was an 'aha' moment for me and now I understand!*.<p>I mean, I did this intuitively, but now I know the name of the technique, which is really good.<p>Thank you, I've learned something new today!
There seem to be a lot of "pretend" functional languages around these days. I have recently been engaging with Scala. Having heard and read so much about how it embraces functional style I was kind of shocked to find the number of limitations and practical impediments to actually using it that way. I am starting to wonder if functional programming has finally fallen victim to the same problem that has afflicted all other methodologies - becoming too popular, part of the hype cycle and getting misinterpreted and misapplied everywhere as a consequence.