Service interruption on Monday 11 July from 12:30 to 13:00: all the sites of the CCSD (HAL, Epiciences, SciencesConf, AureHAL) will be inaccessible (network hardware connection).
Skip to Main content Skip to Navigation
Conference papers

Ambiguous pattern variables

Abstract : The or-pattern (p | q) matches a value v if either p or q match v. It may happen that both p and q match certain values, but that they don’t bind their variables at the same places. OCaml specifies that the left pattern p then takes precedence, but users intuitively expect an angelistic, making the “best” choice. Subtle bugs arise from this mismatch. We here describe a technique based upon pattern matrices that detect such ambiguities. This technique is implemented as a new warning in the OCaml compiler.
Document type :
Conference papers
Complete list of metadata
Contributor : Luc Maranget Connect in order to contact the contributor
Submitted on : Friday, December 9, 2016 - 3:20:54 PM
Last modification on : Wednesday, June 8, 2022 - 12:50:03 PM
Long-term archiving on: : Thursday, March 23, 2017 - 10:24:16 AM


Files produced by the author(s)


  • HAL Id : hal-01413241, version 1



Gabriel Scherer, Luc Maranget, Thomas Réfis. Ambiguous pattern variables. OCaml 2016: The OCaml Users and Developers Workshop, Sep 2016, Nara, Japan. pp.2. ⟨hal-01413241⟩



Record views


Files downloads