diff options
author | Daniil Baturin <daniil@baturin.org> | 2024-11-07 18:02:08 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-07 18:02:08 +0000 |
commit | 196fdd7fdf6dcf751b7364c59e34278bfd0193e3 (patch) | |
tree | cfeff0991481c8281e24cf1698b20a76854059a4 /src/vylist.ml | |
parent | dd9271b4304c6b1a5a2576821d1b2b8fd3aa6bf5 (diff) | |
parent | 9b90d3cc4da72c13ef4270150e4b547ff03fc813 (diff) | |
download | vyconf-196fdd7fdf6dcf751b7364c59e34278bfd0193e3.tar.gz vyconf-196fdd7fdf6dcf751b7364c59e34278bfd0193e3.zip |
Merge pull request #11 from jestabro/vyconf-minimal
T6718: use the vyconf daemon for validation of set commands
Diffstat (limited to 'src/vylist.ml')
-rw-r--r-- | src/vylist.ml | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/src/vylist.ml b/src/vylist.ml deleted file mode 100644 index cd4a32e..0000000 --- a/src/vylist.ml +++ /dev/null @@ -1,46 +0,0 @@ -let rec find p xs = - match xs with - | [] -> None - | y :: ys -> if (p y) then (Some y) - else find p ys - -let rec remove p xs = - match xs with - | [] -> [] - | y :: ys -> if (p y) then ys - else y :: (remove p ys) - -let rec replace p x xs = - match xs with - | [] -> raise Not_found - | y :: ys -> if (p y) then x :: ys - else y :: (replace p x ys) - -let rec insert_before p x xs = - match xs with - | [] -> raise Not_found - | y :: ys -> if (p y) then x :: y :: ys - else y :: (insert_before p x ys) - -let rec insert_after p x xs = - match xs with - | [] -> raise Not_found - | y :: ys -> if (p y) then y :: x :: ys - else y :: (insert_after p x ys) - -let complement xs ys = - let rec aux xs ys = - match xs, ys with - | [], _ -> ys - | _, [] -> assert false (* Can't happen *) - | p :: ps, q :: qs -> if p = q then aux ps qs - else [] - in - if List.length xs < List.length ys then aux xs ys - else aux ys xs - -let in_list xs x = - let x' = find ((=) x) xs in - match x' with - | None -> false - | Some _ -> true |