简体   繁体   中英

F# error: This value is not a function and cannot be applied

 let GetVal (i,isMin,al, be)= 
        let b = new Board(board) 
        if b.SetBoardBool(i) then this.MinMaxAlphaBeta(b, isMin, al, be)
        else -2

    let valList = seq{ 
            for i =0 to 8 do 
                yield (GetVal i (not isMin) alphaF betaF ,  not isMin)
                } 

I am getting an F# error saying: This value is not a function and cannot be applied.

valList is sequence of tuples of int and bool and GetVal takes int bool int int and returns int. where alphaF betaF are mutable variables.

Or you could change the signature of GetVal to not pass a tuple--like this:

let GetVal i isMin al be =

i, isMin, al, and be are called curried parameters. You can find more detail here under the topic "Partial Application of Arguments." I would post a direct link but there doesn't seem to be one.

Your GetVal function takes tupled arguments (a,b,c,d) whilst you call it with curried arguments abcd

Something like this should work

yield (GetVal (i, (not isMin), alphaF, betaF) ,  not isMin)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM