I am having trouble with the following F sharp function:
let compare (a:int option list) (b:int option list) =
let r =
if a.Tail = [None] && b.Tail = [None] then
[None]
elif a.Tail = [None] then
[b.Head;None]
elif b.Tail = [None] then
[a.Head; None]
else
if a=b then
a
else
[None]
r
When I run it with the following arguments
compare [Some 1] [Some 0]
the answer is
[null]
instead of
[None]
Can somebody explain why; Thank you!
Is the way it is displayed but in fact the value is None.
If you try this
You get