Skip to content

Commit

Permalink
Remove Ocaml 5.1's function
Browse files Browse the repository at this point in the history
  • Loading branch information
f52985 committed Oct 4, 2024
1 parent 1d676e2 commit 6a02390
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion spectec/src/il2al/unify.ml
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,12 @@ let reorder_unified_args args prems =
| ExpA e -> has_substring (e |> Il.Print.string_of_exp) (rhs_of_prem p |> Il.Print.string_of_exp)
| _ -> false
in
let index_of p = List.find_index (on_rhs p) args |> Option.get in
let rec find_index f xs =
match xs with
| [] -> 0
| hd :: tl -> if f hd then 0 else 1 + find_index f tl
in
let index_of p = find_index (on_rhs p) args in
let cmp p1 p2 = index_of p1 - index_of p2 in

let uprems, prems = List.partition has_uarg_on_rhs prems in
Expand Down

0 comments on commit 6a02390

Please sign in to comment.