Sml 未绑定变量或构造函数

Sml 未绑定变量或构造函数,sml,smlnj,Sml,Smlnj,我很难用let,in,end定义一个curry函数。 我有以下代码: filter_many listOfFunc listOfElements = let fun allPredicate(element,[]) = true | allPredicate(element,(a,b)::xs) = a(element) andalso (allPredicate(element,xs)) fun isPredicateAux(element) = allP

我很难用let,in,end定义一个curry函数。 我有以下代码:

filter_many listOfFunc listOfElements = 
let
    fun allPredicate(element,[]) = true
        |   allPredicate(element,(a,b)::xs) = a(element) andalso (allPredicate(element,xs))
    fun isPredicateAux(element) = allPredicate(element,listOfFunc)
in
    List.filter isPredicateAux listOfElements
end;
其思想是当a是谓词函数时,获取一个元素列表和一个元组列表(a,b)。(fn'a=>bool)。 函数将返回listofement中的所有元素,这些元素将向listoff函数中的所有谓词返回true。 请在ListOfFunctions中拆分每个元组的第二个变量,以便以后使用

在尝试运行这段代码时,我遇到以下错误:

stdIn:123.54-123.64 Error: unbound variable or constructor: listOfFunc
stdIn:125.30-125.44 Error: unbound variable or constructor: listOfElements
stdIn:1.1-106.11 Error: unbound variable or constructor: filter_many
stdIn:106.12-106.22 Error: unbound variable or constructor: listOfFunc
stdIn:106.23-106.37 Error: unbound variable or constructor: listOfElements
我似乎不明白是什么导致了这个问题。所有的函数和变量都应该被使用它们的人看到。我错过了什么


谢谢。

您忘了在函数声明前写
fun