A Formal Comparison of Approaches to Datatype-Generic Programming
Datatype-generic programming increases program abstraction and reuse by making functions operate uniformly across different types. Many approaches to generic programming have been proposed over the years, most of them for Haskell, but recently also for dependently typed languages such as Agda. Diffe...
Saved in:
| Published in: | arXiv.org |
|---|---|
| Main Authors: | , |
| Format: | Paper |
| Language: | English |
| Published: |
Ithaca
Cornell University Library, arXiv.org
14.02.2012
|
| Subjects: | |
| ISSN: | 2331-8422 |
| Online Access: | Get full text |
| Tags: |
Add Tag
No Tags, Be the first to tag this record!
|
| Abstract | Datatype-generic programming increases program abstraction and reuse by making functions operate uniformly across different types. Many approaches to generic programming have been proposed over the years, most of them for Haskell, but recently also for dependently typed languages such as Agda. Different approaches vary in expressiveness, ease of use, and implementation techniques. Some work has been done in comparing the different approaches informally. However, to our knowledge there have been no attempts to formally prove relations between different approaches. We thus present a formal comparison of generic programming libraries. We show how to formalise different approaches in Agda, including a coinductive representation, and then establish theorems that relate the approaches to each other. We provide constructive proofs of inclusion of one approach in another that can be used to convert between approaches, helping to reduce code duplication across different libraries. Our formalisation also helps in providing a clear picture of the potential of each approach, especially in relating different generic views and their expressiveness. |
|---|---|
| AbstractList | Datatype-generic programming increases program abstraction and reuse by making functions operate uniformly across different types. Many approaches to generic programming have been proposed over the years, most of them for Haskell, but recently also for dependently typed languages such as Agda. Different approaches vary in expressiveness, ease of use, and implementation techniques. Some work has been done in comparing the different approaches informally. However, to our knowledge there have been no attempts to formally prove relations between different approaches. We thus present a formal comparison of generic programming libraries. We show how to formalise different approaches in Agda, including a coinductive representation, and then establish theorems that relate the approaches to each other. We provide constructive proofs of inclusion of one approach in another that can be used to convert between approaches, helping to reduce code duplication across different libraries. Our formalisation also helps in providing a clear picture of the potential of each approach, especially in relating different generic views and their expressiveness. |
| Author | José Pedro Magalhães Löh, Andres |
| Author_xml | – sequence: 1 fullname: José Pedro Magalhães – sequence: 2 givenname: Andres surname: Löh fullname: Löh, Andres |
| BookMark | eNotjrFOwzAUAC0EEqV0Z7TEnPL8bMfJGAVakCrB0L16ceySqomDnSL4eyqV6ba7u2PXQxgcYw8ClqrQGp4o_nTfS4GASywRrtgMpRRZoRBv2SKlAwBgblBrOWNVxVch9nTkdehHil0KAw-eV-MYA9lPl_gU-DNNNP2OLlu7wcXO8o8Y9pH6vhv29-zG0zG5xT_nbLt62dav2eZ9_VZXm4y0UJlpc914S7n1qpCyKchbK5F0WTrjGutbJwk8lG1pXIsCS1KtQQUGBRgt5Jw9XrTnr6-TS9PuEE5xOBd3CIUucgOo5B9FP0yv |
| ContentType | Paper |
| Copyright | 2012. This work is published under http://arxiv.org/licenses/nonexclusive-distrib/1.0/ (the “License”). Notwithstanding the ProQuest Terms and Conditions, you may use this content in accordance with the terms of the License. |
| Copyright_xml | – notice: 2012. This work is published under http://arxiv.org/licenses/nonexclusive-distrib/1.0/ (the “License”). Notwithstanding the ProQuest Terms and Conditions, you may use this content in accordance with the terms of the License. |
| DBID | 8FE 8FG ABJCF ABUWG AFKRA AZQEC BENPR BGLVJ CCPQU DWQXO HCIFZ L6V M7S PHGZM PHGZT PIMPY PKEHL PQEST PQGLB PQQKQ PQUKI PRINS PTHSS |
| DOI | 10.48550/arxiv.1202.2920 |
| DatabaseName | ProQuest SciTech Collection ProQuest Technology Collection Materials Science & Engineering Collection ProQuest Central (Alumni) ProQuest Central UK/Ireland ProQuest Central Essentials ProQuest Central Technology collection ProQuest One Community College ProQuest Central SciTech Premium Collection ProQuest Engineering Collection Engineering Database ProQuest Central Premium ProQuest One Academic Publicly Available Content Database ProQuest One Academic Middle East (New) ProQuest One Academic Eastern Edition (DO NOT USE) ProQuest One Applied & Life Sciences ProQuest One Academic (retired) ProQuest One Academic UKI Edition ProQuest Central China Engineering collection |
| DatabaseTitle | Publicly Available Content Database Engineering Database Technology Collection ProQuest One Academic Middle East (New) ProQuest Central Essentials ProQuest One Academic Eastern Edition ProQuest Central (Alumni Edition) SciTech Premium Collection ProQuest One Community College ProQuest Technology Collection ProQuest SciTech Collection ProQuest Central China ProQuest Central ProQuest One Applied & Life Sciences ProQuest Engineering Collection ProQuest One Academic UKI Edition ProQuest Central Korea Materials Science & Engineering Collection ProQuest Central (New) ProQuest One Academic ProQuest One Academic (New) Engineering Collection |
| DatabaseTitleList | Publicly Available Content Database |
| Database_xml | – sequence: 1 dbid: PIMPY name: Publicly Available Content Database url: http://search.proquest.com/publiccontent sourceTypes: Aggregation Database |
| DeliveryMethod | fulltext_linktorsrc |
| Discipline | Physics |
| EISSN | 2331-8422 |
| Genre | Working Paper/Pre-Print |
| GroupedDBID | 8FE 8FG ABJCF ABUWG AFKRA ALMA_UNASSIGNED_HOLDINGS AZQEC BENPR BGLVJ CCPQU DWQXO FRJ HCIFZ L6V M7S M~E PHGZM PHGZT PIMPY PKEHL PQEST PQGLB PQQKQ PQUKI PRINS PTHSS |
| ID | FETCH-LOGICAL-a514-7d65bfca6cf4833b8afcc32a599e7ebcfde3a0f09d97ed2129a4d724072107513 |
| IEDL.DBID | M7S |
| IngestDate | Mon Jun 30 09:32:08 EDT 2025 |
| IsDoiOpenAccess | true |
| IsOpenAccess | true |
| IsPeerReviewed | false |
| IsScholarly | false |
| Language | English |
| LinkModel | DirectLink |
| MergedId | FETCHMERGED-LOGICAL-a514-7d65bfca6cf4833b8afcc32a599e7ebcfde3a0f09d97ed2129a4d724072107513 |
| Notes | SourceType-Working Papers-1 ObjectType-Working Paper/Pre-Print-1 content type line 50 |
| OpenAccessLink | https://www.proquest.com/docview/2085867024?pq-origsite=%requestingapplication% |
| PQID | 2085867024 |
| PQPubID | 2050157 |
| ParticipantIDs | proquest_journals_2085867024 |
| PublicationCentury | 2000 |
| PublicationDate | 20120214 |
| PublicationDateYYYYMMDD | 2012-02-14 |
| PublicationDate_xml | – month: 02 year: 2012 text: 20120214 day: 14 |
| PublicationDecade | 2010 |
| PublicationPlace | Ithaca |
| PublicationPlace_xml | – name: Ithaca |
| PublicationTitle | arXiv.org |
| PublicationYear | 2012 |
| Publisher | Cornell University Library, arXiv.org |
| Publisher_xml | – name: Cornell University Library, arXiv.org |
| SSID | ssj0002672553 |
| Score | 1.4778196 |
| SecondaryResourceType | preprint |
| Snippet | Datatype-generic programming increases program abstraction and reuse by making functions operate uniformly across different types. Many approaches to generic... |
| SourceID | proquest |
| SourceType | Aggregation Database |
| SubjectTerms | Programming |
| Title | A Formal Comparison of Approaches to Datatype-Generic Programming |
| URI | https://www.proquest.com/docview/2085867024 |
| hasFullText | 1 |
| inHoldings | 1 |
| isFullTextHit | |
| isPrint | |
| link | http://cvtisr.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwpV3PS8MwFH7opuDJ3_hjjhy81rVJ2zQnmXNDQUfRHeZp5CcMdJ3tHP75JrGbB8GLxxIKIQnvfXnvy_cBXNorh8RMZYFMhGsz2jjIFcUBFu6AMK1S7tX1H-hwmI3HLK8LblVNq1zFRB-oVSFdjbzjvCSzlNqUcj1_D5xrlOuu1hYam9B0KgmRp-49r2ssOKUWMZPv7qSX7urw8nO6vIqwe4TFcPgrAvu0Mtj974T2oJnzuS73YUPPDmDb0zlldQjdLho4MPqKemufQVQY1K0VxHWFFgW65RZp2nto4LWnpxLl32StN5vOjmA06I96d0FtlhBwi3kCqtJEGMlTaeKMEJFxIyXBPGFMUy2kUZrw0IRMMaqVzVeMx3ZPvDyaRQ0ROYbGrJjpE0CpZCSW9peY0FgklBPJjdZhLLAghqpTaK0WZFIf-Grysxpnfw-fw47FHNgRn6O4BY1F-aEvYEsuF9OqbEPzpj_Mn9p-H-1Xfv-Yv3wBLqKpCQ |
| linkProvider | ProQuest |
| linkToHtml | http://cvtisr.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMw1V1LTwIxEJ4gaPTkOz5Qe9DjCrS72-3BGAISCEhI5MCNdNtuQqKALKL-KP-j0_LwYOKNg-fNbrrtdOabzvT7AK4x5VBU6MhTQWzLjOgHpebUo7E1EGF0KB27fou321GvJzoZ-FrehbFtlUuf6By1Hil7Rl6wWpJRyDGk3I9fPasaZaurSwmNuVk0zec7pmzpXaOK63tDae2hW6l7C1UBTyI48LgOgzhRMlSJHzEWRzJRilEZCGG4iVWiDZPFpCi04EajYxfSx8E7HjEMryWGn92AHKIIKlyn4NPqSIeGHAE6mxdDHVNYQU4-BrPbErV3vgQt_nL4LorVdv_Z_-9BriPHZrIPGTM8gC3XrKrSQyiXSc1C7WdSWakoklFCygt-dJOS6YhUJeJozLI9x6w9UKQzb0V7wWB9BN11DPoYssPR0JwACZVgvsJXfMb9OOCSKZkYU_RjGrOE61PIL-e_v9jOaf9n8s_-fnwF2_XuY6vfarSb57CD6IraFu-Sn4fsdPJmLmBTzaaDdHLpTIdAf81L9Q0cXAK6 |
| openUrl | ctx_ver=Z39.88-2004&ctx_enc=info%3Aofi%2Fenc%3AUTF-8&rfr_id=info%3Asid%2Fsummon.serialssolutions.com&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.atitle=A+Formal+Comparison+of+Approaches+to+Datatype-Generic+Programming&rft.jtitle=arXiv.org&rft.au=Jos%C3%A9+Pedro+Magalh%C3%A3es&rft.au=L%C3%B6h%2C+Andres&rft.date=2012-02-14&rft.pub=Cornell+University+Library%2C+arXiv.org&rft.eissn=2331-8422&rft_id=info:doi/10.48550%2Farxiv.1202.2920 |