Fluent APIs in Functional Languages (full version)
Ori Roth, Yossi Gil

TL;DR
This paper presents a method for designing fluent APIs in functional programming languages using parametric polymorphism and type inference, enabling compile-time protocol enforcement without relying on function overloading.
Contribution
It introduces a novel approach to implement fluent APIs in functional languages, overcoming the limitations of overloading and supporting complex API protocols.
Findings
Supports all regular and deterministic context-free API protocols
Enables compile-time enforcement of API syntax
Provides a practical alternative to overloading in functional languages
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.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, programming, and type systems · Service-Oriented Architecture and Web Services · Formal Methods in Verification
