The Derivative of a Regular Type is its Type of One-Hole Contexts
The Derivative of a Regular Type is its Type of One-Hole Contexts
复制标题
正则类型的导数是其单孔上下文类型
DOI:
--
复制
发表时间:
2001
期刊:
影响因子:
--
通讯作者:
Conor McBride
中科院分区:
文献类型:
--
作者:
Conor McBride
Polymorphic regular types are tree-like datatypes generated by polynomial type expressions over a set of free variables and closed under least fixed point. The ‘equal-ity types’ of Core ML can be expressed in this form. Given such a type expression T with x free, this paper shows a way to represent the one-hole contexts for elements of x within elements of T , together with an operation which will plug an element of x into the hole of such a context. One-hole contexts are given as inhabitants of a regular type @xT , computed generically from the syntactic structure of T by a mechanism better known as partial differentiation . The relevant notion of containment is shown to be appropriately characterized in terms of derivatives and plugging in. The technology is then exploited to give the one-hole contexts for sub-elements of recursive types in a manner similar to Huet’s ‘zippers’[Hue97].