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

I want to compute a bin as follows:

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

but the compiler complains

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

What am I doing wrong?

+6
source share
1 answer

F # uses single = for the equality operator:

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

Source: https://habr.com/ru/post/983846/


All Articles