#85: typealias for Readability in Swift

typealias does not create a new type, but it can make code much easier to read.

typealias Completion = (Result<Data, Error>) -> Void

That is especially helpful for closures, tuples and long generic types that would otherwise dominate a function signature.

A good typealias can make an API much more approachable without changing its behavior.


I'm also on Twitter and GitHub.

Subscribe via RSS.