X-Git-Url: https://git.distorted.org.uk/~mdw/fringe/blobdiff_plain/2bd37ef118cb1e41cb0e9e2332a9eb69ac2f2df4..8a4f4f075a6e2e90039b172242097a4eca48d60b:/f%23-fringe.fs diff --git a/f#-fringe.fs b/f#-fringe.fs index efcc860..cc00318 100644 --- a/f#-fringe.fs +++ b/f#-fringe.fs @@ -1,4 +1,4 @@ -/// -*-f#-mode-*- +/// -*- mode: fsharp-mode; indent-tabs-mode: nil -*- /// /// F# implementation of a `same-fringe' solver. @@ -41,16 +41,11 @@ let list_iterator it = it |> fold_iterator (curry List.Cons) [] |> List.rev // 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. @@ -119,5 +114,5 @@ let main args = | exc -> fprintf stderr "%s: %s\n" program_name exc.Message 1 - + ///----- That's all, folks --------------------------------------------------