skip to main content
research-article
Open Access

What’s the difference? a functional pearl on subtracting bijections

Published:30 July 2018Publication History
Skip Abstract Section

Abstract

It is a straightforward exercise to write a program to "add" two bijections---resulting in a bijection between two sum types, which runs the first bijection on elements from the left summand and the second bijection on the right. It is much less obvious how to "subtract" one bijection from another. This problem has been studied in the context of combinatorics, with several computational principles known for producing the "difference" of two bijections. We consider the problem from a computational and algebraic perspective, showing how to construct such bijections at a high level, avoiding pointwise reasoning or being forced to construct the forward and backward directions separately---without sacrificing performance.

Skip Supplemental Material Section

Supplemental Material

a101-yorgey.webm

References

  1. Conal Elliott. 2008. Elegant memoization with functional memo tries. (2008). http://conal.net/blog/posts/ elegant- memoization- with- functional- memo- triesGoogle ScholarGoogle Scholar
  2. Conal Elliott. 2018. The MemoTrie package. (2018). http://hackage.haskell.org/package/MemoTrieGoogle ScholarGoogle Scholar
  3. Adriano M Garsia and Stephen C Milne. 1981. Method for constructing bijections for classical partition identities. Proceedings of the National Academy of Sciences 78, 4 (1981), 2026–2028.Google ScholarGoogle ScholarCross RefCross Ref
  4. Basil Gordon. 1983. Sieve-equivalence and explicit bijections. Journal of Combinatorial Theory, Series A 34, 1 (1983), 90–93.Google ScholarGoogle ScholarCross RefCross Ref
  5. Bjarki Ágúst Guðmundsson. 2017. Formalizing the translation method in Agda. Master’s thesis. Reykjavik University, Iceland.Google ScholarGoogle Scholar
  6. André Joyal, Ross Street, and Dominic Verity. 1996. Traced monoidal categories. In Mathematical Proceedings of the Cambridge Philosophical Society, Vol. 119. Cambridge University Press, 447–468.Google ScholarGoogle ScholarCross RefCross Ref
  7. Matthew Pickering, Gergő Érdi, Simon Peyton Jones, and Richard A Eisenberg. 2016. Pattern synonyms. In Proceedings of the 9th International Symposium on Haskell. ACM, 80–91. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. What’s the difference? a functional pearl on subtracting bijections

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      • Published in

        cover image Proceedings of the ACM on Programming Languages
        Proceedings of the ACM on Programming Languages  Volume 2, Issue ICFP
        September 2018
        1133 pages
        EISSN:2475-1421
        DOI:10.1145/3243631
        Issue’s Table of Contents

        Copyright © 2018 Owner/Author

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 30 July 2018
        Published in pacmpl Volume 2, Issue ICFP

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article
      • Article Metrics

        • Downloads (Last 12 months)46
        • Downloads (Last 6 weeks)2

        Other Metrics

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!