Search engine for discovering works of Art, research articles, and books related to Art and Culture
ShareThis
Javascript must be enabled to continue!

Lower your guards: a compositional pattern-match coverage checker

View through CrossRef
A compiler should warn if a function defined by pattern matching does not cover its inputs—that is, if there are missing or redundant patterns. Generating such warnings accurately is difficult for modern languages due to the myriad of language features that interact with pattern matching. This is especially true in Haskell, a language with a complicated pattern language that is made even more complex by extensions offered by the Glasgow Haskell Compiler (GHC). Although GHC has spent a significant amount of effort towards improving its pattern-match coverage warnings, there are still several cases where it reports inaccurate warnings. We introduce a coverage checking algorithm called Lower Your Guards, which boils down the complexities of pattern matching into guard trees . While the source language may have many exotic forms of patterns, guard trees only have three different constructs, which vastly simplifies the coverage checking process. Our algorithm is modular, allowing for new forms of source-language patterns to be handled with little changes to the overall structure of the algorithm. We have implemented the algorithm in GHC and demonstrate places where it performs better than GHC’s current coverage checker, both in accuracy and performance.
Title: Lower your guards: a compositional pattern-match coverage checker
Description:
A compiler should warn if a function defined by pattern matching does not cover its inputs—that is, if there are missing or redundant patterns.
Generating such warnings accurately is difficult for modern languages due to the myriad of language features that interact with pattern matching.
This is especially true in Haskell, a language with a complicated pattern language that is made even more complex by extensions offered by the Glasgow Haskell Compiler (GHC).
Although GHC has spent a significant amount of effort towards improving its pattern-match coverage warnings, there are still several cases where it reports inaccurate warnings.
We introduce a coverage checking algorithm called Lower Your Guards, which boils down the complexities of pattern matching into guard trees .
While the source language may have many exotic forms of patterns, guard trees only have three different constructs, which vastly simplifies the coverage checking process.
Our algorithm is modular, allowing for new forms of source-language patterns to be handled with little changes to the overall structure of the algorithm.
We have implemented the algorithm in GHC and demonstrate places where it performs better than GHC’s current coverage checker, both in accuracy and performance.

Related Results

Development of a Custom Spell-Checker for Emergency Department Data
Development of a Custom Spell-Checker for Emergency Department Data
ObjectiveTo share progress on a custom spell-checker for emergency department chief complaint free-text data and demonstrate a spell-checker validation Shiny application.Introducti...
Hovering and standing guards: nest defense strategies in a polymorphic stingless bee (Tetragonisca angustula)
Hovering and standing guards: nest defense strategies in a polymorphic stingless bee (Tetragonisca angustula)
Abstract The stingless bee, Tetragonisca angustula, has a sophisticated nest defense strategy carried out by guards that are larger compared to other workers. Guards displa...
Compositional Space Parameterization for Flow Simulation
Compositional Space Parameterization for Flow Simulation
Abstract Thermodynamic equilibrium (flash) calculations in compositional simulators are used to find the partitioning of components among fluid phases. The basic ...
Parameterized Strings: Algorithms and Applications
Parameterized Strings: Algorithms and Applications
The parameterized string (p-string), a generalization of the traditional string, is composed of constant and parameter symbols. A parameterized match (p-match) exists between two p...
Design a Low Power and High Speed Parity Checker using Exclusive or Gates
Design a Low Power and High Speed Parity Checker using Exclusive or Gates
In the presented paper we designed the parity checker by using EX-OR modules. The two EX-OR modules are presented to design the parity checker and correlated their outcomes based o...
Blood Cross Matching Without Anti-Human Globulin (AHG) and Bovine Serum: A New Interest for an Old Idea
Blood Cross Matching Without Anti-Human Globulin (AHG) and Bovine Serum: A New Interest for an Old Idea
Abstract  Introduction Transfusion medicine promotes the safety of blood transfusions by rigorously testing to eliminate risks of infection and hemolytic. The efficacy (to correct ...
Mapping the effective coverage of modern contraceptive services in Ethiopia
Mapping the effective coverage of modern contraceptive services in Ethiopia
Introduction Modern contraceptive services are vital for reducing maternal and infant morbidity and mortality. However, in Ethiopia, the effective coverage (quality-adjusted covera...

Back to Top