HackerPapers

arXiv:1601.05106cs.PL

Sound and Complete Bidirectional Typechecking for Higher-Rank Polymorphism with Existentials and Indexed Types

Jana Dunfield, Neelakantan R. Krishnaswami

Early discovery. Linked by one identifiable commenter. This paper is outside the main ranking; a mention is not an endorsement.

Abstract

Bidirectional typechecking, in which terms either synthesize a type or are checked against a known type, has become popular for its applicability to a variety of type systems, its error reporting, and its ease of implementation. Following principles from proof theory, bidirectional typing can be applied to many type constructs. The principles underlying a bidirectional approach to indexed types (generalized algebraic datatypes) are less clear. Building on proof-theoretic treatments of equality, we give a declarative specification of typing based on focalization. This approach permits declarative rules for coverage of pattern matching, as well as support for first-class existential types using a focalized subtyping judgment. We use refinement types to avoid explicitly passing equality proofs in our term syntax, making our calculus similar to languages such as Haskell and OCaml. We also extend the declarative specification with an explicit rules for deducing when a type is principal, permitting us to give a complete declarative specification for a rich type system with significant type inference. We also give a set of algorithmic typing rules, and prove that it is sound and complete with respect to the declarative system. The proof requires a number of technical innovations, including proving soundness and completeness in a mutually recursive fashion.

arXiv comments
28 pages, plus lemmas and proofs (191 pages); accepted to POPL 2019
Journal reference
DOI
Subjects
cs.PLProgramming Languages cs.LOLogic in Computer Science

On Hacker News

Linked by 1 identifiable commenter in 1 comment across 1 thread, from Sep 2020 to Sep 2020.

Comments linking this paper, per year.

Discussed in comments1 thread

  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

Submitted to Hacker News

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