From 2f75b0e951989ff04b1e116a1190390b871bdbed Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sat, 28 Mar 2015 06:43:42 +0600 Subject: Make Vylist.replace raise Not_found for nonexistent elements. --- src/vylist.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/vylist.ml b/src/vylist.ml index 9afea5f..3842076 100644 --- a/src/vylist.ml +++ b/src/vylist.ml @@ -12,7 +12,7 @@ let rec remove p xs = let rec replace p x xs = match xs with - | [] -> [] + | [] -> raise Not_found | x' :: xs' -> if (p x') then x :: xs' else x' :: (replace p x xs') -- cgit v1.2.3