@@ -92,7 +92,7 @@ let head x =
9292
9393let headExn x =
9494 match x with
95- | [] -> [ % assert " headExn " ]
95+ | [] -> raise Not_found
9696 | x ::_ -> x
9797
9898let tail x =
@@ -102,7 +102,7 @@ let tail x =
102102
103103let tailExn x =
104104 match x with
105- | [] -> [ % assert " tailExn " ]
105+ | [] -> raise Not_found
106106 | _ ::t -> t
107107
108108let add xs x = x :: xs
@@ -116,14 +116,14 @@ let rec nthAux x n =
116116let rec nthAuxAssert x n =
117117 match x with
118118 | h ::t -> if n = 0 then h else nthAuxAssert t (n - 1 )
119- | _ -> [ % assert " getExn " ]
119+ | _ -> raise Not_found
120120
121121let get x n =
122122 if n < 0 then None
123123 else nthAux x n
124124
125125let getExn x n =
126- if n < 0 then [ % assert " getExn " ]
126+ if n < 0 then raise Not_found
127127 else nthAuxAssert x n
128128
129129let rec partitionAux p cell precX precY =
@@ -447,22 +447,7 @@ let shuffle xs =
447447 2. raise JS exception, how to pattern match
448448*)
449449
450- (* let fromJson j f = *)
451- (* match J.decodeArray j with *)
452- (* | Some arr -> *)
453- (* let len = Belt_Array.length arr in *)
454- (* if len = 0 then [] *)
455- (* else *)
456- (* let head = (mutableCell (f (A.getUnsafe arr 0) [@bs]) []) in *)
457- (* let cell = ref head in *)
458- (* for i = 1 to len - 1 do *)
459- (* let next = mutableCell (f (A.getUnsafe arr i) [@bs]) [] in *)
460- (* unsafeMutateTail.unsafeMutateTail !cell next ; *)
461- (* cell .contents<- next *)
462- (* done ; *)
463- (* head *)
464- (* | None -> *)
465- (* [%assert "Not array when decoding list"] *)
450+
466451
467452let rec reverseConcat l1 l2 =
468453 match l1 with
0 commit comments