Ambiguous pattern variables - Inria - Institut national de recherche en sciences et technologies du numérique Accéder directement au contenu
Communication Dans Un Congrès Année : 2016

Ambiguous pattern variables

Résumé

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.
Fichier principal
Vignette du fichier
ml-workshop-abstract.pdf (138.7 Ko) Télécharger le fichier
Origine : Fichiers produits par l'(les) auteur(s)

Dates et versions

hal-01413241 , version 1 (09-12-2016)

Identifiants

  • HAL Id : hal-01413241 , version 1

Citer

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⟩

Collections

INRIA INRIA2
75 Consultations
145 Téléchargements

Partager

Gmail Facebook X LinkedIn More