SciTech.blog
SciTech.blog
Applicative functors are less general than functors but more general than monads, which makes them useful in some scenarios. Swift is sufficiently functional to admit a straightforward implementation.
Swift 4.1 brought an improvement to the language's type system called conditional conformance, which allows you to specify that a generic class conforms to a protocol based on the generic arguments' conformance to protocols. A simple example is presented.