You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 19, 2026. It is now read-only.
It would be great to have support for the pipe operator. It is a common way in many functional programming languages to compose functions into a readable left-to-right or top-to-bottom "pipeline" of steps of computation.
I think it should probably behave like in OCaml and not like Elixir, meaning this Caramel code in file main.ml when ran with ocaml compile main.ml && escript main.erl would print 2 (notice the order of arguments in subtract and divide):
letprint_intnumber=Io.format "~0tp~n" [ number ]
letsubtractxy= y - x
letmain_=letdividexy= y / x in10|> subtract 2|> divide 4|> print_int
so it would be equivalent to this Caramel code:
letprint_intnumber=Io.format "~0tp~n" [ number ]
letsubtractxy= y - x
letmain_=letdividexy= y / x in
print_int (divide 4 (subtract 210))
and behave the same as this toplevel OCaml code:
(* let print_int number = Io.format "~0tp~n" [ number ] *)letsubtractxy= y - x ;;
letmain_=letdividexy= y / x in10|> subtract 2|> divide 4|> print_int ;;
main ()
It would be great to have support for the pipe operator. It is a common way in many functional programming languages to compose functions into a readable left-to-right or top-to-bottom "pipeline" of steps of computation.
Documentation in OCaml stdlib
Documentation in Elixir Kernel
I think it should probably behave like in OCaml and not like Elixir, meaning this Caramel code in file
main.mlwhen ran withocaml compile main.ml && escript main.erlwould print2(notice the order of arguments insubtractanddivide):so it would be equivalent to this Caramel code:
and behave the same as this toplevel OCaml code:
when executed: