Taufiq Abdur Rahman
Taufiq Abdur Rahman

Reputation: 1388

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.

Upvotes: 6

Views: 6524

Answers (2)

Onorio Catenacci
Onorio Catenacci

Reputation: 15293

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.

Upvotes: 4

John Palmer
John Palmer

Reputation: 25516

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

Something like this should work

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

Upvotes: 2

Related Questions