Hacker News new | ask | show | jobs
by aplusbi 5423 days ago
Almost, |> isn't an operator in OCaml (although I think Batteries has something like |- that does the same thing) and printfn isn't in OCaml. Printf.printf is, but wouldn't work in this case (you'd need a format string). Also, List.map returns a new list, in OCaml you would probably want to do List.iter.
1 comments

the |> operator is very very simple. ocaml implementation would look something like:

  let (|>) a b = b a ;;