Fluent APIs in Functional Languages
-
Published:2023-04-06
Issue:OOPSLA1
Volume:7
Page:876-901
-
ISSN:2475-1421
-
Container-title:Proceedings of the ACM on Programming Languages
-
language:en
-
Short-container-title:Proc. ACM Program. Lang.
Author:
Roth Ori1ORCID,
Gil Yossi1ORCID
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.
Since fluent API implementations typically rely on overloading function names, they are hard to realize in functional programming languages.
This work shows how functional fluent APIs can be implemented in the absence of name overloading, by relying on parametric polymorphism and Hindley-Milner type inference.
The implementation supports fluent API protocols in the regular- and deterministic context-free language classes, and even beyond.
Publisher
Association for Computing Machinery (ACM)
Subject
Safety, Risk, Reliability and Quality,Software
Reference57 articles.
1. Alfred V. Aho and Jeffrey D . Ullman . 1977 . Principles of Compiler Design (Addison-Wesley Series in Computer Science and Information Processing). Addison-Wesley Longman Publishing Co. , Inc., USA. isbn:0201000229 Alfred V. Aho and Jeffrey D. Ullman. 1977. Principles of Compiler Design (Addison-Wesley Series in Computer Science and Information Processing). Addison-Wesley Longman Publishing Co., Inc., USA. isbn:0201000229
2. Typestate-oriented programming
3. Paradise
4. The Clara Framework for Hybrid Typestate;Bodden Eric;Analysis. Int. J. Softw. Tools Technol. Transf.,2012
5. Type checking higher-order polymorphic multi-methods
Cited by
1 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Type Automata;Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis;2023-07-12