Warnings for pattern matching

LUC MARANGET
Inria Rocquencourt, BP 105, 78153 Le Chesnay Cedex, France

Published in the Journal of Functional Programming

Local Postscript and Pdf versions.

Abstract: We examine the ML pattern-matching anomalies of useless clauses and non-exhaustive matches. We state the definition of these anomalies, building upon pattern matching semantics, and propose a simple algorithm to detect them. We have integrated the algorithm in the Objective Caml compiler, but we show that the same algorithm is also usable in a non-strict language such as Haskell. Or-patterns are considered for both strict and non-strict languages.

Part I
An algorithm for detecting the anomalies

Part II
Implementation


This document was translated from LATEX by HEVEA.