RosettaCodeData/Task/Singly-linked-list-Element-insertion/OCaml/singly-linked-list-element-insertion.ocaml

5 lines
165 B
Text
Raw Permalink Normal View History

2013-04-11 01:07:29 -07:00
let rec insert_after a b = function
c :: cs when a = c -> a :: b :: cs
| c :: cs -> c :: insert_after a b cs
| [] -> raise Not_found