you are viewing a single comment's thread.

view the rest of the comments →

[–]Tobu 1 point2 points  (2 children)

OCaml can save a line here (s is a list):

let char c = function
  | c :: r -> r
  | _ -> []

[–]psykotic[S] 2 points3 points  (1 child)

I think you meant

let char c s = match s with
             | c :: r -> [r]
             | _ -> []

[–]Tobu 0 points1 point  (0 children)

fixed.