{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,8,24]],"date-time":"2026-08-24T08:41:56Z","timestamp":1787560916981,"version":"build-2736575974"},"reference-count":37,"publisher":"Association for Computing Machinery (ACM)","issue":"ICFP","license":[{"start":{"date-parts":[[2018,7,30]],"date-time":"2018-07-30T00:00:00Z","timestamp":1532908800000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["Proc. ACM Program. Lang."],"published-print":{"date-parts":[[2018,7,30]]},"abstract":"<jats:p>Functional programmers have an established tradition of using traversals as a design pattern to work with recursive data structures. The technique is so prolific that a whole host of libraries have been designed to help in the task of automatically providing traversals by analysing the generic structure of data types. More recently, lenses have entered the functional scene and have proved themselves to be a simple and versatile mechanism for working with product types. They make it easy to focus on the salient parts of a data structure in a composable and reusable manner.<\/jats:p>\n          <jats:p>This paper uses the combination of lenses and traversals to give rise to a library with unprecedented expressivity and flexibility for querying and modifying complex data structures. Furthermore, since lenses and traversals are based on the generic shape of data, this information is used to generate code that is as efficient as hand-optimised versions. The technique leverages the structure of data to produce generic abstractions that are then eliminated by the standard workhorses of modern functional compilers: inlining and specialisation.<\/jats:p>","DOI":"10.1145\/3236780","type":"journal-article","created":{"date-parts":[[2018,7,31]],"date-time":"2018-07-31T19:41:18Z","timestamp":1533066078000},"page":"1-30","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":7,"title":["Generic deriving of generic traversals"],"prefix":"10.1145","volume":"2","author":[{"given":"Csongor","family":"Kiss","sequence":"first","affiliation":[{"name":"Imperial College London, UK"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Matthew","family":"Pickering","sequence":"additional","affiliation":[{"name":"University of Bristol, UK"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Nicolas","family":"Wu","sequence":"additional","affiliation":[{"name":"University of Bristol, UK"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"320","published-online":{"date-parts":[[2018,7,30]]},"reference":[{"key":"e_1_2_2_1_1","doi-asserted-by":"publisher","DOI":"10.1145\/2430532.2364509"},{"key":"e_1_2_2_2_1","doi-asserted-by":"publisher","DOI":"10.1145\/2543728.2543730"},{"key":"e_1_2_2_3_1","doi-asserted-by":"publisher","DOI":"10.1016\/j.scico.2015.09.003"},{"key":"e_1_2_2_4_1","unstructured":"Lennart Augustsson. 2018. geniplate-mirror-0.7.6 library. http:\/\/hackage.haskell.org\/package\/geniplate-mirror-0.7.6  Lennart Augustsson. 2018. geniplate-mirror-0.7.6 library. http:\/\/hackage.haskell.org\/package\/geniplate-mirror-0.7.6"},{"key":"e_1_2_2_5_1","doi-asserted-by":"publisher","DOI":"10.1145\/2503778.2503781"},{"key":"e_1_2_2_6_1","unstructured":"Maximilian C. Bolingbroke. 2011. Constraint Kinds for GHC. http:\/\/blog.omega-prime.co.uk\/2011\/09\/10\/ constraint-kinds-for-ghc\/  Maximilian C. Bolingbroke. 2011. Constraint Kinds for GHC. http:\/\/blog.omega-prime.co.uk\/2011\/09\/10\/ constraint-kinds-for-ghc\/"},{"key":"e_1_2_2_7_1","volume-title":"Beyond correct and fast: Inspection Testing. CoRR abs\/1803.07130","author":"Breitner Joachim","year":"2018","unstructured":"Joachim Breitner . 2018. Beyond correct and fast: Inspection Testing. CoRR abs\/1803.07130 ( 2018 ). arXiv: 1803.07130 http:\/\/arxiv.org\/abs\/1803.07130 Joachim Breitner. 2018. Beyond correct and fast: Inspection Testing. CoRR abs\/1803.07130 (2018). arXiv: 1803.07130 http:\/\/arxiv.org\/abs\/1803.07130"},{"key":"e_1_2_2_8_1","doi-asserted-by":"publisher","DOI":"10.1145\/2692915.2628141"},{"key":"e_1_2_2_9_1","doi-asserted-by":"publisher","DOI":"10.1145\/1040305.1040306"},{"key":"e_1_2_2_10_1","doi-asserted-by":"publisher","DOI":"10.1145\/2633628.2633634"},{"key":"e_1_2_2_11_1","doi-asserted-by":"publisher","DOI":"10.1145\/2535838.2535856"},{"key":"e_1_2_2_12_1","volume-title":"Proceedings of the 25th European Symposium on Programming Languages and Systems -","volume":"9632","author":"Eisenberg Richard A.","unstructured":"Richard A. Eisenberg , Stephanie Weirich , and Hamidhasan G. Ahmed . 2016. Visible Type Application . In Proceedings of the 25th European Symposium on Programming Languages and Systems - Volume 9632 . Springer-Verlag New York, Inc., New York, NY, USA, 229\u2013254. Richard A. Eisenberg, Stephanie Weirich, and Hamidhasan G. Ahmed. 2016. Visible Type Application. In Proceedings of the 25th European Symposium on Programming Languages and Systems - Volume 9632. Springer-Verlag New York, Inc., New York, NY, USA, 229\u2013254."},{"key":"e_1_2_2_13_1","unstructured":"Andrew Farmer. 2015. HERMIT: Mechanized Reasoning during Compilation in the Glasgow Haskell Compiler. Ph.D. Dissertation. University of Kansas USA. http:\/\/hdl.handle.net\/1808\/19416  Andrew Farmer. 2015. HERMIT: Mechanized Reasoning during Compilation in the Glasgow Haskell Compiler. Ph.D. Dissertation. University of Kansas USA. http:\/\/hdl.handle.net\/1808\/19416"},{"key":"e_1_2_2_14_1","doi-asserted-by":"publisher","DOI":"10.1145\/325694.325709"},{"key":"e_1_2_2_15_1","doi-asserted-by":"publisher","DOI":"10.1017\/S0956796815000088"},{"key":"e_1_2_2_16_1","unstructured":"Edward Kmett. 2018. lens-4.16 library. https:\/\/hackage.haskell.org\/package\/lens-4.16  Edward Kmett. 2018. lens-4.16 library. https:\/\/hackage.haskell.org\/package\/lens-4.16"},{"key":"e_1_2_2_17_1","doi-asserted-by":"publisher","DOI":"10.1145\/604174.604179"},{"key":"e_1_2_2_18_1","doi-asserted-by":"publisher","DOI":"10.1145\/1016850.1016883"},{"key":"e_1_2_2_19_1","doi-asserted-by":"publisher","DOI":"10.1145\/1863523.1863529"},{"key":"e_1_2_2_20_1","volume-title":"Symposium on Implementation and Application of Functional Languages. Springer, 104\u2013121","author":"Magalh\u00e3es Jos\u00e9 Pedro","year":"2012","unstructured":"Jos\u00e9 Pedro Magalh\u00e3es . 2012 . Optimisation of generic programs through inlining . In Symposium on Implementation and Application of Functional Languages. Springer, 104\u2013121 . Jos\u00e9 Pedro Magalh\u00e3es. 2012. Optimisation of generic programs through inlining. In Symposium on Implementation and Application of Functional Languages. Springer, 104\u2013121."},{"key":"e_1_2_2_21_1","volume-title":"Generic Programming with Multiple Parameters","author":"Magalh\u00e3es Jos\u00e9 Pedro","unstructured":"Jos\u00e9 Pedro Magalh\u00e3es . 2014. Generic Programming with Multiple Parameters . In Functional and Logic Programming, Michael Codish and Eijiro Sumii (Eds.). Springer International Publishing , Cham , 136\u2013151. Jos\u00e9 Pedro Magalh\u00e3es. 2014. Generic Programming with Multiple Parameters. In Functional and Logic Programming, Michael Codish and Eijiro Sumii (Eds.). Springer International Publishing, Cham, 136\u2013151."},{"key":"e_1_2_2_22_1","doi-asserted-by":"publisher","DOI":"10.1017\/S0956796807006326"},{"key":"e_1_2_2_23_1","doi-asserted-by":"publisher","DOI":"10.1145\/1291201.1291208"},{"key":"e_1_2_2_24_1","volume-title":"Functor is to Lens as Applicative is to Biplate: Introducing Multiplate. CoRR abs\/1103.2841","author":"O\u2019Connor Russell","year":"2011","unstructured":"Russell O\u2019Connor . 2011. Functor is to Lens as Applicative is to Biplate: Introducing Multiplate. CoRR abs\/1103.2841 ( 2011 ). Russell O\u2019Connor. 2011. Functor is to Lens as Applicative is to Biplate: Introducing Multiplate. CoRR abs\/1103.2841 (2011)."},{"key":"e_1_2_2_25_1","doi-asserted-by":"publisher","DOI":"10.1017\/S0956796802004331"},{"key":"e_1_2_2_26_1","doi-asserted-by":"publisher","DOI":"10.1017\/S0956796806006034"},{"key":"e_1_2_2_27_1","volume-title":"A List of Successes That Can Change the World","author":"Jones Simon Peyton","unstructured":"Simon Peyton Jones , Stephanie Weirich , Richard A Eisenberg , and Dimitrios Vytiniotis . 2016. A reflection on types . In A List of Successes That Can Change the World . Springer , 292\u2013317. Simon Peyton Jones, Stephanie Weirich, Richard A Eisenberg, and Dimitrios Vytiniotis. 2016. A reflection on types. In A List of Successes That Can Change the World. Springer, 292\u2013317."},{"key":"e_1_2_2_28_1","doi-asserted-by":"publisher","DOI":"10.1016\/S0167-6423(97)00029-4"},{"key":"e_1_2_2_29_1","doi-asserted-by":"publisher","DOI":"10.22152\/programming-journal.org\/2017\/1\/7"},{"key":"e_1_2_2_30_1","doi-asserted-by":"publisher","DOI":"10.1017\/S0956796806006137"},{"key":"e_1_2_2_31_1","volume-title":"CPS-Based Functional References. (July","author":"van Laarhoven Twan","year":"2009","unstructured":"Twan van Laarhoven . 2009. CPS-Based Functional References. (July 2009 ). http:\/\/www.twanvl.nl\/blog\/haskell\/ cps-functional-references Twan van Laarhoven. 2009. CPS-Based Functional References. (July 2009). http:\/\/www.twanvl.nl\/blog\/haskell\/ cps-functional-references"},{"key":"e_1_2_2_32_1","unstructured":"Sjoerd Visscher and Li-yao Xia. 2018. one-liner-1.0 library. http:\/\/hackage.haskell.org\/package\/one-liner-1.0  Sjoerd Visscher and Li-yao Xia. 2018. one-liner-1.0 library. http:\/\/hackage.haskell.org\/package\/one-liner-1.0"},{"key":"e_1_2_2_33_1","doi-asserted-by":"publisher","DOI":"10.1017\/S0956796811000098"},{"key":"e_1_2_2_34_1","doi-asserted-by":"publisher","DOI":"10.1145\/75277.75283"},{"key":"e_1_2_2_35_1","doi-asserted-by":"publisher","DOI":"10.1145\/1926385.1926411"},{"key":"e_1_2_2_36_1","doi-asserted-by":"publisher","DOI":"10.1145\/3110273"},{"key":"e_1_2_2_37_1","doi-asserted-by":"publisher","DOI":"10.1145\/2103786.2103795"}],"container-title":["Proceedings of the ACM on Programming Languages"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3236780","content-type":"unspecified","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3236780","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,6,18]],"date-time":"2025-06-18T21:41:28Z","timestamp":1750282888000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3236780"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2018,7,30]]},"references-count":37,"journal-issue":{"issue":"ICFP","published-print":{"date-parts":[[2018,7,30]]}},"alternative-id":["10.1145\/3236780"],"URL":"https:\/\/doi.org\/10.1145\/3236780","relation":{},"ISSN":["2475-1421"],"issn-type":[{"value":"2475-1421","type":"electronic"}],"subject":[],"published":{"date-parts":[[2018,7,30]]},"assertion":[{"value":"2018-07-30","order":2,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}