{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,7,16]],"date-time":"2026-07-16T10:10:03Z","timestamp":1784196603661,"version":"3.55.0"},"reference-count":21,"publisher":"Association for Computing Machinery (ACM)","issue":"ICFP","content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["Proc. ACM Program. Lang."],"published-print":{"date-parts":[[2025,8,5]]},"abstract":"<jats:p>Bidirectional transformations (BXs) are a widely adopted approach for data synchronisation that is usually\n\t\t\tbased on two functions, one from the source to the view and one back. Traditionally, these functions must not\n\t\t\thave side effects. While a few frameworks aim to lift this restriction by introducing monads into lenses, they\n\t\t\tare still quite limited, e.g., allowing only side effects in the backwards transformation.<\/jats:p>\n                  <jats:p>In this paper, we propose a much more general framework for effectful lenses. Our effectful lenses can have\n\t\t\tdifferent effects in their two directions, and the effects need not be cancellable. We also define the round-trip\n\t\t\trelations and use them to generalise the two well-known round-trip properties to effectful lenses. Moreover,\n\t\t\tcomposition preserves the two well-known round-trip properties, and we also provide a rich combinator\n\t\t\tlanguage, which enables compositional programming for effectful lenses. Finally, we present a case study to\n\t\t\tillustrate the flexibility and expressivity of our framework.<\/jats:p>","DOI":"10.1145\/3747523","type":"journal-article","created":{"date-parts":[[2025,8,5]],"date-time":"2025-08-05T16:56:02Z","timestamp":1754412962000},"page":"541-566","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":1,"title":["Effectful Lenses: There and Back with Different Monads"],"prefix":"10.1145","volume":"9","author":[{"ORCID":"https:\/\/orcid.org\/0000-0001-7201-1954","authenticated-orcid":false,"given":"Ruifeng","family":"Xie","sequence":"first","affiliation":[{"name":"Peking University, Beijing, China"},{"name":"KU Leuven, Leuven, Belgium"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0001-8771-5559","authenticated-orcid":false,"given":"Tom","family":"Schrijvers","sequence":"additional","affiliation":[{"name":"KU Leuven, Leuven, Belgium"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-9034-205X","authenticated-orcid":false,"given":"Zhenjiang","family":"Hu","sequence":"additional","affiliation":[{"name":"Peking University, Beijing, China"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"320","published-online":{"date-parts":[[2025,8,5]]},"reference":[{"key":"e_1_3_2_2_1","doi-asserted-by":"publisher","unstructured":"Faris Abou-Saleh James Cheney Jeremy Gibbons James McKinna and Perdita Stevens. 2016. Reflections on Monadic Lenses. Springer International Publishing Cham 1\u201331. doi:10.1007\/978-3-319-30936-1_1","DOI":"10.1007\/978-3-319-30936-1_1"},{"key":"e_1_3_2_3_1","doi-asserted-by":"publisher","unstructured":"Artem Alimarine Sjaak Smetsers Arjen van Weelden Marko van Eekelen and Rinus Plasmeijer. 2005. There and back again: arrows for invertible programming. In Proceedings of the 2005 ACM SIGPLAN workshop on Haskell (Haskell \u201905). Association for Computing Machinery New York NY USA 86\u201397. doi:10.1145\/1088348.1088357","DOI":"10.1145\/1088348.1088357"},{"key":"e_1_3_2_4_1","doi-asserted-by":"publisher","DOI":"10.1145\/319628.319634"},{"key":"e_1_3_2_5_1","doi-asserted-by":"publisher","unstructured":"Davi M.J. Barbosa Julien Cretin Nate Foster Michael Greenberg and Benjamin C. Pierce. 2010. Matching lenses: alignment and view update. In Proceedings of the 15th ACM SIGPLAN international conference on Functional programming (ICFP \u201910). Association for Computing Machinery New York NY USA 193\u2013204. doi:10.1145\/1863543.1863572","DOI":"10.1145\/1863543.1863572"},{"key":"e_1_3_2_6_1","unstructured":"James Cheney James McKinna Perdita Stevens Jeremy Gibbons and Faris Abou-Saleh. 2014. Entangled state monads. CEUR Workshop Proceedings 1133 (6 March 2014) 108\u2013111. 2014 Joint Workshops on International Conference on Extending Database Technology and International Conference on Database Theory EDBT\/ICDT-WS 2014 ; Conference date: 28-03-2014 Through 28-03-2014."},{"key":"e_1_3_2_7_1","doi-asserted-by":"publisher","unstructured":"Bryce Clarke Derek Elkins Jeremy Gibbons Fosco Loregi\u00e0n Bartosz Milewski Emily Pillmore and Mario Rom\u00e1n. 2022. Profunctor Optics a Categorical Update. Technical Report. doi:10.48550\/arXiv.2001.07488 arXiv:2001.07488 [cs math] version: 2 type: article.","DOI":"10.48550\/arXiv.2001.07488"},{"key":"e_1_3_2_8_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-642-02408-5_19"},{"key":"e_1_3_2_9_1","doi-asserted-by":"publisher","DOI":"10.1145\/2854695.2854700"},{"key":"e_1_3_2_10_1","doi-asserted-by":"publisher","DOI":"10.1145\/1232420.1232424"},{"key":"e_1_3_2_11_1","doi-asserted-by":"publisher","unstructured":"Martin Hofmann Benjamin Pierce and Daniel Wagner. 2011. Symmetric lenses. In Proceedings of the 38th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL \u201911). Association for Computing Machinery New York NY USA 371\u2013384. doi:10.1145\/1926385.1926428","DOI":"10.1145\/1926385.1926428"},{"key":"e_1_3_2_12_1","doi-asserted-by":"publisher","DOI":"10.1145\/1926385.1926428"},{"key":"e_1_3_2_13_1","unstructured":"Joachim Lambek. 1980. From lambda-calculus to cartesian closed categories. Academic Press London 375\u2013402."},{"key":"e_1_3_2_14_1","doi-asserted-by":"publisher","unstructured":"Joachim Lambek. 1986. Cartesian closed categories and typed \u03bb-calculi. Springer Berlin Heidelberg 136\u2013175. doi:10.1007\/3-540-17184-3_44","DOI":"10.1007\/3-540-17184-3_44"},{"key":"e_1_3_2_15_1","unstructured":"Simon Marlow. 2010. Haskell 2010 Language Report. Technical Report. https:\/\/www.haskell.org\/onlinereport\/haskell2010\/"},{"key":"e_1_3_2_16_1","doi-asserted-by":"publisher","unstructured":"Kazutaka Matsuda and Meng Wang. 2015. Applicative bidirectional programming with lenses. In Proceedings of the 20th ACM SIGPLAN International Conference on Functional Programming (ICFP 2015). Association for Computing Machinery New York NY USA 62\u201374. doi:10.1145\/2784731.2784750","DOI":"10.1145\/2784731.2784750"},{"key":"e_1_3_2_17_1","doi-asserted-by":"publisher","unstructured":"Ulf Norell. 2009. Dependently Typed Programming in Agda. Springer Berlin Heidelberg 230\u2013266. doi:10.1007\/978-3-642-04652-0_5","DOI":"10.1007\/978-3-642-04652-0_5"},{"key":"e_1_3_2_18_1","doi-asserted-by":"crossref","unstructured":"Hugo Pacheco and Alcino Cunha. 2010. Generic point-free lenses. In Proceedings of the 10th International Conference on Mathematics of Program Construction (Qu\u00e9bec Canada) (MPC\u201910). Springer-Verlag Berlin Heidelberg 331\u2013352.","DOI":"10.1007\/978-3-642-13321-3_19"},{"key":"e_1_3_2_19_1","doi-asserted-by":"publisher","unstructured":"Hugo Pacheco Zhenjiang Hu and Sebastian Fischer. 2014. Monadic combinators for \u201cPutback\u201d style bidirectional programming. In Proceedings of the ACM SIGPLAN 2014 Workshop on Partial Evaluation and Program Manipulation (PEPM \u201914). Association for Computing Machinery New York NY USA 39\u201350. doi:10.1145\/2543728.2543737","DOI":"10.1145\/2543728.2543737"},{"key":"e_1_3_2_20_1","doi-asserted-by":"publisher","unstructured":"Li-yao Xia Dominic Orchard and Meng Wang. 2019. Composing Bidirectional Programs Monadically. In Programming Languages and Systems (Lecture Notes in Computer Science) Lu\u00eds Caires (Ed.). Springer International Publishing Cham 147\u2013175. doi10.1007\/978-3-030-17184-1_6","DOI":"10.1007\/978-3-030-17184-1_6"},{"key":"e_1_3_2_21_1","doi-asserted-by":"publisher","unstructured":"Ruifeng Xie Tom Schrijvers and Zhenjiang Hu. 2025a. Artifact for ICFP \u201925: Effectful Lenses: There and Back with Different Monads. doi:10.5281\/zenodo.15656096","DOI":"10.5281\/zenodo.15656096"},{"key":"e_1_3_2_22_1","doi-asserted-by":"publisher","DOI":"10.1145\/3704910"}],"container-title":["Proceedings of the ACM on Programming Languages"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3747523","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,7,16]],"date-time":"2026-07-16T10:01:17Z","timestamp":1784196077000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3747523"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2025,8,5]]},"references-count":21,"journal-issue":{"issue":"ICFP","published-print":{"date-parts":[[2025,8,5]]}},"alternative-id":["10.1145\/3747523"],"URL":"https:\/\/doi.org\/10.1145\/3747523","relation":{},"ISSN":["2475-1421"],"issn-type":[{"value":"2475-1421","type":"electronic"}],"subject":[],"published":{"date-parts":[[2025,8,5]]},"assertion":[{"value":"2025-02-27","order":0,"name":"received","label":"Received","group":{"name":"publication_history","label":"Publication History"}},{"value":"2025-06-27","order":2,"name":"accepted","label":"Accepted","group":{"name":"publication_history","label":"Publication History"}},{"value":"2025-08-05","order":3,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}