Deconstraining DSLs
Deconstraining DSLs
复制标题
解除 DSL 的约束
DOI:
--
复制
发表时间:
2012
期刊:
影响因子:
--
通讯作者:
T. O. R. Allwood
中科院分区:
文献类型:
--
作者:
W. Jones;T. Field;T. O. R. Allwood
Strongly-typed functional languages provide a powerful framework for embedding Domain-Specific Languages (DSLs). However, building type-safe functions defined over an embedded DSL can introduce application-specific type constraints that end up being imposed on the DSL data types themselves. At best, these constraints are unwieldy and at worst they can limit the range of DSL expressions that can be built. We present a simple solution to this problem that allows application-specific constraints to be specified at the point of use of a DSL expression rather than when the DSL's embedding types are defined. Our solution applies equally to both tagged and tagless representations and, importantly, also works in the presence of higher-rank types.