Skip to content

Commit

Permalink
Keep only one implemenation of List.concat_map
Browse files Browse the repository at this point in the history
  • Loading branch information
Gbury committed Nov 6, 2023
1 parent 55fdf07 commit 195f564
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/standard/expr.ml
Original file line number Diff line number Diff line change
Expand Up @@ -400,16 +400,6 @@ let list_take l n =
in
aux [] l n

(* List.concat_map *)
let list_concat_map f l =
let rec aux acc f = function
| [] -> List.rev acc
| x :: r ->
let l = f x in
aux (List.rev_append l acc) f r
in
aux [] f l

(* List.find_map *)
let rec list_find_map f = function
| [] -> None
Expand Down Expand Up @@ -1607,10 +1597,10 @@ module Term = struct
| [] | _ :: _ :: _-> assert false (* internal error *)

let specialise_matrix arity c p =
list_concat_map (specialise_row arity c) p
Misc.list_concat_map (specialise_row arity c) p

let default_matrix (p : matrix) : matrix =
list_concat_map (function
Misc.list_concat_map (function
| [] -> assert false
| p_i_1 :: p_i_r ->
begin match p_i_1.head with
Expand Down

0 comments on commit 195f564

Please sign in to comment.