Use Option.isNone rather than a multiline pattern match, and use a
pattern guard to reduce failure cases.
// Asnwer whether two iterators report the same items.
let rec same_iterators_p ita itb =
match next ita with
- | None ->
- match next itb with
- | None -> true
- | _ -> false
+ | None -> Option.isNone(next itb)
| Some (a, ita) ->
match next itb with
- | None -> false
- | Some (b, itb) ->
- if a = b then same_iterators_p ita itb
- else false
+ | Some (b, itb) when a = b -> same_iterators_p ita itb
+ | _ -> false
///--------------------------------------------------------------------------
/// Nodes and trees.