Fluent APIs in Functional Languages (full version)

1 min read Original article ↗

View PDF

Abstract:Fluent API is an object-oriented pattern for elegant APIs and embedded DSLs. A smart fluent API can enforce the API protocol or DSL syntax at compile time. As fluent API designs typically rely on function overloading, they are hard to realize in functional programming languages. We show how to write functional fluent APIs using parametric polymorphism and type inference instead of overloading. Our designs support all regular and deterministic context-free API protocols and beyond.

Submission history

From: Ori Roth [view email]
[v1] Wed, 2 Nov 2022 20:33:32 UTC (87 KB)
[v2] Fri, 10 Feb 2023 12:40:09 UTC (98 KB)