Hacker News new | past | comments | ask | show | jobs | submit login

Pipes work really well with named arguments and partial-application. Both functionalities make it easy to get the unary function you want with minimal cruft. Lambdas solve the more complex case.

In Ocaml, you often end up doing things like:

     List.create 0 3 
     |> List.map ~f:(fun x -> x+1)
     |> List.fold ~init:0 ~f:(fun acc x -> x+acc)
     |> Stdio.print_endline "%d"
I'm ambivalent about adding them to JS however. It's a nice feature but I don't think it works well with the rest of the syntax.



Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: