A typechecker plugin for units of measure: domain-specific constraint solving in GHC Haskell
A typechecker plugin for units of measure: domain-specific constraint solving in GHC Haskell
复制标题
测量单位的类型检查器插件:GHC Haskell 中的特定领域约束求解
DOI:
--
复制
发表时间:
2015
期刊:
影响因子:
--
通讯作者:
Adam Gundry
中科院分区:
文献类型:
--
作者:
Adam Gundry
Typed functional programming and units of measure are a natural combination, as F# ably demonstrates. However, encoding statically-checked units in Haskell’s type system leads to inevitable disappointment with the usability of the resulting system. Extending the language itself would produce a much better result, but it would be a lot of work! In this paper, I demonstrate how typechecker plugins in the Glasgow Haskell Compiler allow users to define domain-specific constraint solving behaviour, making it possible to implement units of measure as a type system extension without rebuilding the compiler. This paves the way for a more modular treatment of constraint solving in GHC.