I have this function:
let myFunction list (var1, var2) : bool =
for (x,y) in list do
match (var1, var2) with
| (1, 11) | (2, 22) -> true
| (_, _) ->
if not (x = y) then
true // error is here
false
This returns an error saying that the function expects the value returned to have type bool, not unit. What I want to achieve is to return true whenever x != y so the loop should stop there; otherwise to return false at the end.