A Bowtie for a Beast: Overloading, Eta Expansion, and Extensible Data Types in F

The typed merge operator offers the promise of a compositional style of statically-typed programming in which solutions to the expression problem arise naturally. This approach, dubbed compositional programming, has recently been demonstrated by Zhang et al. Unfortunately, the merge operator is an u...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
Veröffentlicht in:Proceedings of ACM on programming languages 2023-01, Vol.7 (POPL), p.515-543, Article 18
Hauptverfasser: Rioux, Nick, Huang, Xuejing, Oliveira, Bruno C. d. S., Zdancewic, Steve
Format: Artikel
Sprache:eng
Schlagworte:
Online-Zugang:Volltext
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
container_end_page 543
container_issue POPL
container_start_page 515
container_title Proceedings of ACM on programming languages
container_volume 7
creator Rioux, Nick
Huang, Xuejing
Oliveira, Bruno C. d. S.
Zdancewic, Steve
description The typed merge operator offers the promise of a compositional style of statically-typed programming in which solutions to the expression problem arise naturally. This approach, dubbed compositional programming, has recently been demonstrated by Zhang et al. Unfortunately, the merge operator is an unwieldy beast. Merging values from overlapping types may be ambiguous, so disjointness relations have been introduced to rule out undesired nondeterminism and obtain a well-behaved semantics. Past type systems using a disjoint merge operator rely on intersection types, but extending such systems to include union types or overloaded functions is problematic: naively adding either reintroduces ambiguity. In a nutshell: the elimination forms of unions and overloaded functions require values to be distinguishable by case analysis, but the merge operator can create exotic values that violate that requirement. This paper presents F⋈, a core language that demonstrates how unions, intersections, and overloading can all coexist with a tame merge operator. The key is an underlying design principle that states that any two inhabited types can support either the deterministic merging of their values, or the ability to distinguish their values, but never both. To realize this invariant, we decompose previously studied notions of disjointness into two new, dual relations that permit the operation that best suits each pair of types. This duality respects the polarization of the type structure, yielding an expressive language that we prove to be both type safe and deterministic.
doi_str_mv 10.1145/3571211
format Article
fullrecord <record><control><sourceid>acm_cross</sourceid><recordid>TN_cdi_crossref_primary_10_1145_3571211</recordid><sourceformat>XML</sourceformat><sourcesystem>PC</sourcesystem><sourcerecordid>3571211</sourcerecordid><originalsourceid>FETCH-LOGICAL-a1921-825822c8268162440c44f1f57ad53dbcf37a75a7d7f51216dfb44a87318af0b93</originalsourceid><addsrcrecordid>eNpNkM1Lw0AUxBdRsNTi3dPevDS6bz-yG2_9SFUo1EM9h5fsrkTSpOwGtf-9kVbxNG-YHw9mCLkGdgcg1b1QGjjAGRlxqVUCksP5v_uSTGJ8Z4xBJqQR2Yi8zOi8--xrR30XKNK5w9g_0M2HC02Htm7fpjTvkeZfe2xj3bVTiq0dbO8GWzaOLnGIt4e9i7Ru6eqKXHhsopucdExeV_l28ZSsN4_Pi9k6Qcg4JIYrw3lleGog5VKySkoPXmm0Stiy8kKjVqit9mpolFpfSolGCzDoWZmJMbk9_q1CF2NwvtiHeofhUAArfrYoTlsM5M2RxGr3B_2G35X5Vaw</addsrcrecordid><sourcetype>Aggregation Database</sourcetype><iscdi>true</iscdi><recordtype>article</recordtype></control><display><type>article</type><title>A Bowtie for a Beast: Overloading, Eta Expansion, and Extensible Data Types in F</title><source>ACM Digital Library Complete</source><source>Elektronische Zeitschriftenbibliothek - Frei zugängliche E-Journals</source><creator>Rioux, Nick ; Huang, Xuejing ; Oliveira, Bruno C. d. S. ; Zdancewic, Steve</creator><creatorcontrib>Rioux, Nick ; Huang, Xuejing ; Oliveira, Bruno C. d. S. ; Zdancewic, Steve</creatorcontrib><description>The typed merge operator offers the promise of a compositional style of statically-typed programming in which solutions to the expression problem arise naturally. This approach, dubbed compositional programming, has recently been demonstrated by Zhang et al. Unfortunately, the merge operator is an unwieldy beast. Merging values from overlapping types may be ambiguous, so disjointness relations have been introduced to rule out undesired nondeterminism and obtain a well-behaved semantics. Past type systems using a disjoint merge operator rely on intersection types, but extending such systems to include union types or overloaded functions is problematic: naively adding either reintroduces ambiguity. In a nutshell: the elimination forms of unions and overloaded functions require values to be distinguishable by case analysis, but the merge operator can create exotic values that violate that requirement. This paper presents F⋈, a core language that demonstrates how unions, intersections, and overloading can all coexist with a tame merge operator. The key is an underlying design principle that states that any two inhabited types can support either the deterministic merging of their values, or the ability to distinguish their values, but never both. To realize this invariant, we decompose previously studied notions of disjointness into two new, dual relations that permit the operation that best suits each pair of types. This duality respects the polarization of the type structure, yielding an expressive language that we prove to be both type safe and deterministic.</description><identifier>ISSN: 2475-1421</identifier><identifier>EISSN: 2475-1421</identifier><identifier>DOI: 10.1145/3571211</identifier><language>eng</language><publisher>New York, NY, USA: ACM</publisher><subject>Data types and structures ; Functional languages ; Patterns ; Software and its engineering ; Theory of computation ; Type theory</subject><ispartof>Proceedings of ACM on programming languages, 2023-01, Vol.7 (POPL), p.515-543, Article 18</ispartof><rights>Owner/Author</rights><lds50>peer_reviewed</lds50><oa>free_for_read</oa><woscitedreferencessubscribed>false</woscitedreferencessubscribed><citedby>FETCH-LOGICAL-a1921-825822c8268162440c44f1f57ad53dbcf37a75a7d7f51216dfb44a87318af0b93</citedby><cites>FETCH-LOGICAL-a1921-825822c8268162440c44f1f57ad53dbcf37a75a7d7f51216dfb44a87318af0b93</cites><orcidid>0000-0002-1846-7210 ; 0000-0002-8496-491X ; 0000-0001-5277-8920 ; 0000-0002-3516-1512</orcidid></display><links><openurl>$$Topenurl_article</openurl><openurlfulltext>$$Topenurlfull_article</openurlfulltext><thumbnail>$$Tsyndetics_thumb_exl</thumbnail><linktopdf>$$Uhttps://dl.acm.org/doi/pdf/10.1145/3571211$$EPDF$$P50$$Gacm$$Hfree_for_read</linktopdf><link.rule.ids>314,776,780,2276,27901,27902,40172,75970</link.rule.ids></links><search><creatorcontrib>Rioux, Nick</creatorcontrib><creatorcontrib>Huang, Xuejing</creatorcontrib><creatorcontrib>Oliveira, Bruno C. d. S.</creatorcontrib><creatorcontrib>Zdancewic, Steve</creatorcontrib><title>A Bowtie for a Beast: Overloading, Eta Expansion, and Extensible Data Types in F</title><title>Proceedings of ACM on programming languages</title><addtitle>ACM PACMPL</addtitle><description>The typed merge operator offers the promise of a compositional style of statically-typed programming in which solutions to the expression problem arise naturally. This approach, dubbed compositional programming, has recently been demonstrated by Zhang et al. Unfortunately, the merge operator is an unwieldy beast. Merging values from overlapping types may be ambiguous, so disjointness relations have been introduced to rule out undesired nondeterminism and obtain a well-behaved semantics. Past type systems using a disjoint merge operator rely on intersection types, but extending such systems to include union types or overloaded functions is problematic: naively adding either reintroduces ambiguity. In a nutshell: the elimination forms of unions and overloaded functions require values to be distinguishable by case analysis, but the merge operator can create exotic values that violate that requirement. This paper presents F⋈, a core language that demonstrates how unions, intersections, and overloading can all coexist with a tame merge operator. The key is an underlying design principle that states that any two inhabited types can support either the deterministic merging of their values, or the ability to distinguish their values, but never both. To realize this invariant, we decompose previously studied notions of disjointness into two new, dual relations that permit the operation that best suits each pair of types. This duality respects the polarization of the type structure, yielding an expressive language that we prove to be both type safe and deterministic.</description><subject>Data types and structures</subject><subject>Functional languages</subject><subject>Patterns</subject><subject>Software and its engineering</subject><subject>Theory of computation</subject><subject>Type theory</subject><issn>2475-1421</issn><issn>2475-1421</issn><fulltext>true</fulltext><rsrctype>article</rsrctype><creationdate>2023</creationdate><recordtype>article</recordtype><recordid>eNpNkM1Lw0AUxBdRsNTi3dPevDS6bz-yG2_9SFUo1EM9h5fsrkTSpOwGtf-9kVbxNG-YHw9mCLkGdgcg1b1QGjjAGRlxqVUCksP5v_uSTGJ8Z4xBJqQR2Yi8zOi8--xrR30XKNK5w9g_0M2HC02Htm7fpjTvkeZfe2xj3bVTiq0dbO8GWzaOLnGIt4e9i7Ru6eqKXHhsopucdExeV_l28ZSsN4_Pi9k6Qcg4JIYrw3lleGog5VKySkoPXmm0Stiy8kKjVqit9mpolFpfSolGCzDoWZmJMbk9_q1CF2NwvtiHeofhUAArfrYoTlsM5M2RxGr3B_2G35X5Vaw</recordid><startdate>20230109</startdate><enddate>20230109</enddate><creator>Rioux, Nick</creator><creator>Huang, Xuejing</creator><creator>Oliveira, Bruno C. d. S.</creator><creator>Zdancewic, Steve</creator><general>ACM</general><scope>AAYXX</scope><scope>CITATION</scope><orcidid>https://orcid.org/0000-0002-1846-7210</orcidid><orcidid>https://orcid.org/0000-0002-8496-491X</orcidid><orcidid>https://orcid.org/0000-0001-5277-8920</orcidid><orcidid>https://orcid.org/0000-0002-3516-1512</orcidid></search><sort><creationdate>20230109</creationdate><title>A Bowtie for a Beast: Overloading, Eta Expansion, and Extensible Data Types in F</title><author>Rioux, Nick ; Huang, Xuejing ; Oliveira, Bruno C. d. S. ; Zdancewic, Steve</author></sort><facets><frbrtype>5</frbrtype><frbrgroupid>cdi_FETCH-LOGICAL-a1921-825822c8268162440c44f1f57ad53dbcf37a75a7d7f51216dfb44a87318af0b93</frbrgroupid><rsrctype>articles</rsrctype><prefilter>articles</prefilter><language>eng</language><creationdate>2023</creationdate><topic>Data types and structures</topic><topic>Functional languages</topic><topic>Patterns</topic><topic>Software and its engineering</topic><topic>Theory of computation</topic><topic>Type theory</topic><toplevel>peer_reviewed</toplevel><toplevel>online_resources</toplevel><creatorcontrib>Rioux, Nick</creatorcontrib><creatorcontrib>Huang, Xuejing</creatorcontrib><creatorcontrib>Oliveira, Bruno C. d. S.</creatorcontrib><creatorcontrib>Zdancewic, Steve</creatorcontrib><collection>CrossRef</collection><jtitle>Proceedings of ACM on programming languages</jtitle></facets><delivery><delcategory>Remote Search Resource</delcategory><fulltext>fulltext</fulltext></delivery><addata><au>Rioux, Nick</au><au>Huang, Xuejing</au><au>Oliveira, Bruno C. d. S.</au><au>Zdancewic, Steve</au><format>journal</format><genre>article</genre><ristype>JOUR</ristype><atitle>A Bowtie for a Beast: Overloading, Eta Expansion, and Extensible Data Types in F</atitle><jtitle>Proceedings of ACM on programming languages</jtitle><stitle>ACM PACMPL</stitle><date>2023-01-09</date><risdate>2023</risdate><volume>7</volume><issue>POPL</issue><spage>515</spage><epage>543</epage><pages>515-543</pages><artnum>18</artnum><issn>2475-1421</issn><eissn>2475-1421</eissn><abstract>The typed merge operator offers the promise of a compositional style of statically-typed programming in which solutions to the expression problem arise naturally. This approach, dubbed compositional programming, has recently been demonstrated by Zhang et al. Unfortunately, the merge operator is an unwieldy beast. Merging values from overlapping types may be ambiguous, so disjointness relations have been introduced to rule out undesired nondeterminism and obtain a well-behaved semantics. Past type systems using a disjoint merge operator rely on intersection types, but extending such systems to include union types or overloaded functions is problematic: naively adding either reintroduces ambiguity. In a nutshell: the elimination forms of unions and overloaded functions require values to be distinguishable by case analysis, but the merge operator can create exotic values that violate that requirement. This paper presents F⋈, a core language that demonstrates how unions, intersections, and overloading can all coexist with a tame merge operator. The key is an underlying design principle that states that any two inhabited types can support either the deterministic merging of their values, or the ability to distinguish their values, but never both. To realize this invariant, we decompose previously studied notions of disjointness into two new, dual relations that permit the operation that best suits each pair of types. This duality respects the polarization of the type structure, yielding an expressive language that we prove to be both type safe and deterministic.</abstract><cop>New York, NY, USA</cop><pub>ACM</pub><doi>10.1145/3571211</doi><tpages>29</tpages><orcidid>https://orcid.org/0000-0002-1846-7210</orcidid><orcidid>https://orcid.org/0000-0002-8496-491X</orcidid><orcidid>https://orcid.org/0000-0001-5277-8920</orcidid><orcidid>https://orcid.org/0000-0002-3516-1512</orcidid><oa>free_for_read</oa></addata></record>
fulltext fulltext
identifier ISSN: 2475-1421
ispartof Proceedings of ACM on programming languages, 2023-01, Vol.7 (POPL), p.515-543, Article 18
issn 2475-1421
2475-1421
language eng
recordid cdi_crossref_primary_10_1145_3571211
source ACM Digital Library Complete; Elektronische Zeitschriftenbibliothek - Frei zugängliche E-Journals
subjects Data types and structures
Functional languages
Patterns
Software and its engineering
Theory of computation
Type theory
title A Bowtie for a Beast: Overloading, Eta Expansion, and Extensible Data Types in F
url https://sfx.bib-bvb.de/sfx_tum?ctx_ver=Z39.88-2004&ctx_enc=info:ofi/enc:UTF-8&ctx_tim=2025-02-09T06%3A48%3A14IST&url_ver=Z39.88-2004&url_ctx_fmt=infofi/fmt:kev:mtx:ctx&rfr_id=info:sid/primo.exlibrisgroup.com:primo3-Article-acm_cross&rft_val_fmt=info:ofi/fmt:kev:mtx:journal&rft.genre=article&rft.atitle=A%20Bowtie%20for%20a%20Beast:%20Overloading,%20Eta%20Expansion,%20and%20Extensible%20Data%20Types%20in%20F&rft.jtitle=Proceedings%20of%20ACM%20on%20programming%20languages&rft.au=Rioux,%20Nick&rft.date=2023-01-09&rft.volume=7&rft.issue=POPL&rft.spage=515&rft.epage=543&rft.pages=515-543&rft.artnum=18&rft.issn=2475-1421&rft.eissn=2475-1421&rft_id=info:doi/10.1145/3571211&rft_dat=%3Cacm_cross%3E3571211%3C/acm_cross%3E%3Curl%3E%3C/url%3E&disable_directlink=true&sfx.directlink=off&sfx.report_link=0&rft_id=info:oai/&rft_id=info:pmid/&rfr_iscdi=true