Concurrent Clean : type variable of type of lifted argument a appears in the specified type
というエラーが以下のコードで発生する。
module lift Start = 1 ::MyType d = MyType d subst :: d (MyType d) -> MyType d subst newdata (MyType data) = inner where inner :: MyType d inner = MyType newdata
http://mailman.science.ru.nl/pipermail/clean-list/2005/002834.htmlに多少の解説があるが、
In the specification of a type of a locally defined function one cannot refer to a type variable introduced in the type specification of a surrounding function (there is not yet a scope rule on types defined). The programmer can therefore not specify the type of such a local function. However, the type will be inferred and checked (after it is lifted by the compiler to the global level) by the type system.
要は、パラメータ付き型の解決の際、局所関数をグローバルレベルに"lift"して型チェックを行うので、親関数の変数の型を取る事ができないということらしい。
・・・その制限はきつい。