How difficult would it be to add the infix notation à la Haskell?

Is that really more clear/expressive than this?

fn x ->
  x
  |> Binary.new!()
  |> then(& &1.raw)
  |> B.mk_url!()
end

or even

fn x ->
  binary = Binary.new!(x)
  B.mk_url(binary.raw)
end

I guess it’s a matter of preference but the only thing valuable I see in your example is map as a more general(as in generic functor map) instead of just Enum.map.

I get the value of a Functor and maybe even Monad or Monoid in your codebase if you enjoy these generalised operations in your codebase, but when it comes to functional composition I find the examples in this thread rather alien and fail to see what’s so pragmatic about it in this language.

2 Likes