Guessing Swift takes a similar approach in [SE-0185](https://github.com/apple/swift-evolution/blob/098152eafbfbd7faa74d81e1443231bd7caabc45/proposals/0185-synthesize-equatable-hashable.md).
A paradigm is sneaking in when you aren’t paying attention. Pay attention. There’s a chance here to influence development practice for decades We really can have languages that give the benefits of tomorrow without losing all the working components of today. I think Swift can be one of those languages. Much of that, I believe, is education.
SE-0156’s note about merging `class` and `AnyObject` reference-type existentials
Whenever I mentally parse `protocol SomeProtocol: SomeOtherProtocol`, it’s meant to imply `SomeProtocol` adds additional requirements onto another protocol, namely `SomeOtherProtocol`’s. What’s odd about class-constraining protocols is that it’s been a weird historical inconsistency in Swift where the term to the right of the `:` _isn’t_ a protocol and instead a reserved word. All reference types implicitly conform to `AnyObject`, which, being a protocol, makes it a more consistent way of class constraining than remembering the special `: class` trick. This merging of concepts was lightly mentioned in [SE-0156](https://github.com/apple/swift-evolution/blame/93abb54833e2d9ee7ee842882f6104a867de3069/proposals/0156-subclass-existentials.md#L134) (link to specific line).
This maintains proposals for changes and user-visible enhancements to the Swift Programming Language. - swift-evolution/proposals/0244-opaque-result-types.md at b1caeccf5d273a1cc53b331d41ea169f7729...
it’s reassuring to know that the folks driving changes in Swift have a solid background in language design, and that they’re thinking about all manner of hard problems in order to make our lives easier. However, it makes me worry that people might be missing out on a truly exciting conversation about what might be coming in a future Swift version. The reason for the label “reverse generics” is that the flow of information is backwards from the existing system. Where right now, the caller binds generic types as it calls a function, the proposal would have the function itself bind the return types and pass concrete values back out.
One of the most common patterns I see in software design with Objective-C (and sometimes Swift), is the use of enumeration types (enum) as configurations for...
History: Why does closure syntax use the keyword `in`?
It's my fault, sorry. In the early days of Swift, we had a closure syntax that was very similar to traditional Javascript, func (arg: Type, arg: Type) -> Return { ... }. While this is nice and regular syntax, it is of course also very bulky and awkward if you're trying to support expressive functional APIs, such as map/filter on collections, or if you want libraries to be able to provide closure-based APIs that feel like extensions of the language. Our earliest adopters at Apple complained about...
Backticks ('`Type`') are another good alternative (that I keep forgetting exists). pic.twitter.com/ILz3ODm07V— Ole Begemann (@olebegemann) January 30, 2019
On needing to “ground the type” when asking about a generic typealias and Tagged
“@jasdev @mbrandonw We still need to bind Outer to something to use it at a call site and ground the type. Any remaining generic allows us to create different types, like Email and Email, which might be totally what we want! But they’re diff types.”
Pullbacks’ influence on the Automatic Differentiation Manifesto
“Look up pullbacks in differential geometry and you will find the image on the left. Look up pullbacks in category theory and you will find the image on the right, which generalizes everything in one diagram. That is the type of generality that libraries should strive for.”
Say, for whatever reason, you were in desperate need of Bill the Cat ASCII art in your app. Maybe you were very drunk and had a bet. Maybe you were working with some kind of Unix awk client. I dunn…
“@jckarter @Javi @mdiep The space of things that are typey enough to need labels but not typey enough to get a name and call a struct is pretty small.”
“Free map functions express the nesting nicely: map: ((A) -> B) -> (Signal) -> Signal map: ((A) -> B) -> ([A]) -> [B] Then the nested map is function composition: (map < map): ((A) -> B) -> (Signal
Even though Swift only supports unary and binary operators for operator overloading, it's possible to implement our *own* ternary operators by declaring two separate operators that work together and using a *curried function* for one of the operators.
I begin to feel that I can trust mathematics as a guiding beacon for how programming can be done well. This is why I feel strongly that simple mathematical constructs, like pure functions, monoids, etc., form a strong foundation of abstraction as opposed to the overly complicated, and often ad-hoc, design patterns we see in software engineering. I spend a lot of my time trying to find new and creative ways to bring seemingly complex functional programming ideas down to earth and make them approachable to a wider audience. but it does give us an opportunity to explore a strange and surprising result in computation and mathematics. It can help show that the connection between the two topics is perhaps deeper than we may first think.