Open Access. Powered by Scholars. Published by Universities.®

Physical Sciences and Mathematics Commons

Open Access. Powered by Scholars. Published by Universities.®

Programming Languages and Compilers

Computer Science Faculty Research and Scholarship

Constraint solver

Articles 1 - 1 of 1

Full-Text Articles in Physical Sciences and Mathematics

The Thoralf Plugin: For Your Fancy Type Needs, Divesh Otwani, Richard A. Eisenberg Sep 2018

The Thoralf Plugin: For Your Fancy Type Needs, Divesh Otwani, Richard A. Eisenberg

Computer Science Faculty Research and Scholarship

Many fancy types (e.g., generalized algebraic data types, type families) require a type checker plugin. These fancy types have a type index (e.g., type level natural numbers) with an equality relation that is difficult or impossible to represent using GHC’s built-in type equality. The most practical way to represent these equality relations is through a plugin that asserts equality constraints. However, such plugins are difficult to write and reason about. In this paper, we (1) present a formal theory of reasoning about the correctness of type checker plugins for type indices, and, (2) apply this theory in creating Thoralf, a …