paperbot · PL 论文追踪

RSS

Partial type constructors: or, making ad hoc datatypes less ad hoc

POPL 4(POPL)2019
Mark P. Jones, J. Garrett Morris, Richard A. Eisenberg

尚未生成 AI 速览(可能缺少 API key 或等待下次运行补跑)。

原文摘要(Abstract)

Functional programming languages assume that type constructors are total. Yet functional programmers know better: counterexamples range from container types that make limiting assumptions about their contents (e.g., requiring computable equality or ordering functions) to type families with defining equations only over certain choices of arguments. We present a language design and formal theory of partial type constructors, capturing the domains of type constructors using qualified types. Our design is both simple and expressive: we support partial datatypes as first-class citizens (including as instances of parametric abstractions, such as the Haskell Functor and Monad classes), and show a simple type elaboration algorithm that avoids placing undue annotation burden on programmers. We show that our type system rejects ill-defined types and can be compiled to a semantic model based on System F. Finally, we have conducted an experimental analysis of a body of Haskell code, using a proof-of-concept implementation of our system; while there are cases where our system requires additional annotations, these cases are rarely encountered in practical Haskell code.

链接与引用

DOI 原文 ·

BibTeX
@article{paperbot553,
  title = {Partial type constructors: or, making ad hoc datatypes less ad hoc},
  author = {Mark P. Jones and J. Garrett Morris and Richard A. Eisenberg},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {4},
  number = {POPL},
  year = {2019},
  doi = {10.1145/3371108}
}