A general framework for effectful bidirectional programming: There and back with different monads

This is the manuscript submitted to JFP for review. It is an extended version of the ICFP 2025 paper, Effectful Lenses: There and Back with Different Monads by the same three authors. Below is the abstract of the paper. Bidirectional transformations (BXs) are a widely adopted approach for data synchronisation that is usually based on two functions, one from the source to the view and one back. Traditionally, these functions must not have side effects. While a few frameworks aim to lift this restriction by introducing monads into lenses, they are still quite limited, e.g., allowing only side effects in the backwards transformation, or allowing only some fixed effects. In this article, we propose a much more general framework for effectful bidirectional programming, with different user-selected effects in their two directions. Our bidirectional programs take the simple form of effectful isomorphisms, but effectful lenses are also supported as a special case of the framework by mixing in two special effects. We generalise the two well-known round-trip properties to the effectful setup by introducing the free compositions and pure-likeness properties. Moreover, we show that composition preserves the two well-known round-trip properties, and we also provide a rich combinator language, which enables compositional programming for effectful lenses. Finally, we present a case study to illustrate the flexibility and expressivity of our framework.

Authors

Institutions

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-09-18
DOI
https://doi.org/10.5281/zenodo.22822674
Primary Topic
Model-Driven Software Engineering Techniques
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
preprint

A general framework for effectful bidirectional programming: There and back with different monads

Ruifeng Xie, Tom Schrijvers, Zhenjiang Hu
Zenodo (CERN European Organization for Nuclear Research)
Model-Driven Software Engineering Techniques
preprint

A general framework for effectful bidirectional programming: There and back with different monads

Ruifeng Xie, Tom Schrijvers, Zhenjiang Hu
preprint en

Abstract

This is the manuscript submitted to JFP for review. It is an extended version of the ICFP 2025 paper, Effectful Lenses: There and Back with Different Monads by the same three authors. Below is the abstract of the paper. Bidirectional transformations (BXs) are a widely adopted approach for data synchronisation that is usually based on two functions, one from the source to the view and one back. Traditionally, these functions must not have side effects. While a few frameworks aim to lift this restriction by introducing monads into lenses, they are still quite limited, e.g., allowing only side effects in the backwards transformation, or allowing only some fixed effects. In this article, we propose a much more general framework for effectful bidirectional programming, with different user-selected effects in their two directions. Our bidirectional programs take the simple form of effectful isomorphisms, but effectful lenses are also supported as a special case of the framework by mixing in two special effects. We generalise the two well-known round-trip properties to the effectful setup by introducing the free compositions and pure-likeness properties. Moreover, we show that composition preserves the two well-known round-trip properties, and we also provide a rich combinator language, which enables compositional programming for effectful lenses. Finally, we present a case study to illustrate the flexibility and expressivity of our framework.

Zenodo (CERN European Organization for Nuclear Research)
Chinese Academy of Sciences (CN), Peking University (CN), KU Leuven (BE)
Model-Driven Software Engineering Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

A general framework for effectful bidirectional programming: There and back with different monads — Ruifeng Xie, Tom Schrijvers, et al. · Zenodo (CERN European Organization for Nuclear Research) (2026) | TGRS Research Map | TGRS