Skip to content

Commit

Permalink
refactor(Utils): clean up unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
favonia committed Oct 28, 2024
1 parent ed4799c commit d5e3645
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions src/Utils.ml
Original file line number Diff line number Diff line change
Expand Up @@ -19,45 +19,6 @@ let dump_list p fmt l =
(Format.pp_print_list ~pp_sep:(fun fmt () -> Format.fprintf fmt ";@ ") p)
l

(* Currently note used
{[
let rec drop_while p =
function
| x :: xs when p x -> (drop_while[@tailcall]) p xs
| l -> l
]}
*)

let keep_first_in_groups p =
function
| [] -> []
| x :: xs ->
let[@tail_mod_cons] rec go x =
function
| [] -> [x]
| y :: ys when p x y -> (go[@tailcall]) x ys
| y :: ys -> x :: (go[@tailcall]) y ys
in
go x xs

(* Currently note used
{[
let group p =
function
| [] -> []
| x :: xs ->
let[@tail_mod_cons] rec go acc x =
function
| [] -> [acc @> [x]]
| y :: ys when p x y -> (go[@tailcall]) (acc <: x) y ys
| y :: ys -> (acc @> [x]) :: (go[@tailcall]) Emp y ys
in
go Emp x xs
]}
*)

let maximum = List.fold_left Int.max Int.min_int

let compare_pair c1 c2 (x1, y1) (x2, y2) : int =
Expand Down

0 comments on commit d5e3645

Please sign in to comment.