We present a kind inference algorithm for the FREEST programming language. The input to the algorithm is FREEST source code with (possibly part of) kind annotations replaced by kind variables. The algorithm infers concrete kinds for all kind variables. We ran the algorithm on the FREEST test suite by first replacing kind annotation on all type variables by fresh kind variables, and concluded that the algorithm correctly infers all kinds. Non surprisingly, we found out that programmers do not choose the most general kind in 20% of the cases.
翻译:我们提出了一种针对FREEST编程语言的Kind类型推导算法。算法的输入是FREEST源代码,将其中(可能部分的)kind注释替换为kind变量。该算法推导出所有kind变量的具体类型。我们在FREEST测试套件上运行了该算法,首先将所有类型变量的Kind注释替换为新的kind变量,经验证该算法正确推导了所有kind。毫不意外,我们发现在20%的情况下,程序员没有选择最一般的kind。