About flatMap, compactMap and monads
A discussion about monads, whether Swift's flatMap is monadic, where you can use monads in Swift and where you can use some monad-like behaviors in Swift.
A discussion about monads, whether Swift's flatMap is monadic, where you can use monads in Swift and where you can use some monad-like behaviors in Swift.
I show how to structure programs around three tiers of computational units – statements, messages and reducers – and talk about the general problem of containing and isolating state that this restructuring aims to address.
In this article, I’ll look at a little theory and history behind the primary application design pattern used in Cocoa. I’ll discuss the key shortcoming of Cocoa’s Model-View-Controller approach, Apple’s aborted efforts to address this shortcoming and wonder from where the next major improvements will come.
There's an industry-wide push for protocol-oriented programming where shared interfaces, behaviors and substitutability are provided through protocols rather than subclasses. In this article though, I'll look at a case where I chose to use a subclass, instead of a protocol, to take advantage of some specific differences between classes and protocols.
I look at what's required to use the Swift Package Manager to transparently fetch dependencies during an Xcode build phase.
A light hearted look back at my time programming in the 1990s as I try to get an old Minesweeper implementation of mine from 1999, written in C++ using PowerPlant for Mac OS 8, compiling in Xcode 8 and running on macOS Sierra.
Just a little helper class that I use to round off the rough edges when dealing with Cocoa's key-value observing.
A discussion about reference counted lifetimes in Swift; how the lifetime of scope variables differs from C++ and Objective-C, how releases are reordered by the Swift compiler and the conventional use of withExtendedLifetime versus my unconventional usage.
I'll explain why I consider reactive programming to be one of the most important design patterns for application programming by looking at three scenarios that are common in application development, yet are a drain on development time, lead to frequent bugs and make design and refactoring hard. I'll show how reactive programming addresses the verbosity, eliminates the unsafety and restructures the code to aid maintainability.
In this article, I'm presenting CwlSignal. It is the latest Swift iteration of a library that I've been using for reactive programming for the last few years. CwlSignal is simple, fast, threadsafe and full-featured while offering a number of unique abilities.