English

Fluent APIs in Functional Languages (full version)

Programming Languages 2023-03-13 v2

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.

Keywords

Cite

@article{arxiv.2211.01473,
  title  = {Fluent APIs in Functional Languages (full version)},
  author = {Ori Roth and Yossi Gil},
  journal= {arXiv preprint arXiv:2211.01473},
  year   = {2023}
}
R2 v1 2026-06-28T05:03:41.140Z