Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

f#

 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.

like image 370
Taufiq Abdur Rahman Avatar asked Oct 05 '13 07:10

Taufiq Abdur Rahman


Video Answer


1 Answers

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.

like image 185
Onorio Catenacci Avatar answered Sep 30 '22 14:09

Onorio Catenacci