HackerPapers

arXiv:1306.6032cs.PL

Complete and Easy Bidirectional Typechecking for Higher-Rank Polymorphism

Jana Dunfield, Neelakantan R. Krishnaswami

Abstract

Bidirectional typechecking, in which terms either synthesize a type or are checked against a known type, has become popular for its scalability (unlike Damas-Milner type inference, bidirectional typing remains decidable even for very expressive type systems), its error reporting, and its relative ease of implementation. Following design principles from proof theory, bidirectional typing can be applied to many type constructs. The principles underlying a bidirectional approach to polymorphism, however, are less obvious. We give a declarative, bidirectional account of higher-rank polymorphism, grounded in proof theory; this calculus enjoys many properties such as eta-reduction and predictability of annotations. We give an algorithm for implementing the declarative system; our algorithm is remarkably simple and well-behaved, despite being both sound and complete.

arXiv comments
13 pages + 78-page appendix, to appear in International Conference on Functional Programming (ICFP) 2013
Journal reference
DOI
Subjects
cs.PLProgramming Languages

On Hacker News

Linked by 3 identifiable commenters in 3 comments across 3 threads, from Aug 2017 to Sep 2020.

Comments linking this paper, per year.

Discussed in comments3 threads

  1. What Is Math? 1 comment
    • I certainly have a lot of recommendations that are topic adjacent, but most of my comment comes from mental revision. I have a horrible habit of reliving previous arguments and trying to find out what I could have said better to win the argument. I had an argument with a law…

      throwaway17_17View on HNParent context

    • Hindley-Milner is cool, but if you're planning on implementing a language with type inference, I strongly suggest you take inspiration from bidirectional type inference, notably Pierce-Turner[1] and subsequently Dunfield-Krishnaswami[2]. These algorithms are capable of inferring…

      iitalicsView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.