arXiv · 1702.02281
GADTs and Exhaustiveness: Looking for the Impossible
Abstract
Sound exhaustiveness checking of pattern-matching is an essential feature of functional programming languages, and OCaml supports it for GADTs. However this check is incomplete, in that it may fail to detect that a pattern can match no concrete value. In this paper we show that this problem is actually undecidable, but that we can strengthen the exhaustiveness and redundancy checks so that they cover more practical cases. The new algorithm relies on a clever modification of type inference for patterns.
Explore related subjects
Keep this discovery
Jacques Garrigue, Jacques Le Normand. 2017-02-08. GADTs and Exhaustiveness: Looking for the Impossible. https://doi.org/10.4204/eptcs.241.2
Cite the original work for its findings. Save a collection to share your selection of sources.