Session-ocaml: A Session-Based Library with Polarities and Lenses
Session-ocaml: A Session-Based Library with Polarities and Lenses
复制标题
Session-ocaml:具有极性和透镜的基于会话的库
DOI:
10.1007/978-3-319-59746-1_6
复制
发表时间:
2017
期刊:
影响因子:
--
通讯作者:
Yuen Shoji
中科院分区:
文献类型:
--
作者:
Imai Keigo;Yoshida Nobuko;Yuen Shoji
We proposesession-ocaml, a novel library for session-typed concurrent/distributed programming in OCaml. Our technique solely relies on parametric polymorphism, which can encode core session type structures with strong static guarantees. Our key ideas are: (1)polarised session types, which give an alternative formulation of duality enabling OCaml to automatically infer an appropriate session type in a session with a reasonable notational overhead; and (2) aparameterised monadwith a data structure called ‘slots’ manipulated withlenses, which can statically enforce session linearity including delegations. We introduce a notational extension to enhance the session linearity for integrating the session types into the functional programming style. We show applications ofsession-ocamlto a travel agency use case and an SMTP protocol implementation. Furthermore, we evaluate the performance of on a number of benchmarks.