计算机科学 > 程序设计语言
[提交于 2015年2月17日]
标题:Type Classes for Lightweight Substructural Types
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读摘要:Linear and substructural types are powerful tools, but adding them to standard functional programming languages often means introducing extra annotations and typing machinery. We propose a lightweight substructural type system design that recasts the structural rules of weakening and contraction as type classes; we demonstrate this design in a prototype language, Clamp. Clamp supports polymorphic substructural types as well as an expressive system of mutable references. At the same time, it adds little additional overhead to a standard Damas-Hindley-Milner type system enriched with type classes. We have established type safety for the core model and implemented a type checker with type inference in Haskell.
提交历史
来自:EPTCS[v1] 2015年2月17日 星期二 02:27:31 UTC