Builders

Section • 3 episodes • 1 hr 44 min

Result builders are a powerful feature of Swift that enable DSLs like SwiftUI using familiar syntax. We will explore what result builders have to say about parsing by getting an understanding of how they work before implementing a result builder layer over our parsing library.

Where to go from here

Parsers currently use optionality to model failure. This makes parser definitions more awkward than they should be, and completely obscures where and why parsing failed. We can look to throwing functions for a solution to both these problems.