Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The type 'int' does not support the operator '=='

Tags:

f#

I want to calculate binom like this:

let t = seq { 1..10 } |> Seq.takeWhile (fun e -> e % 2 == 0)

but the compiler complain

playground.fsx(27,59): error FS0001: The type 'int' does not support the operator '=='

What am I doing wrong?

like image 260
softshipper Avatar asked Mar 16 '15 06:03

softshipper


Video Answer


1 Answers

F# uses single = for equality operator:

let t = seq { 1..10 } |> Seq.takeWhile (fun e -> e % 2 = 0)
like image 74
MarcinJuraszek Avatar answered Oct 13 '22 17:10

MarcinJuraszek