Here I try to implement a simple pipe forward operator similar to |> operator in Elixir or the andThen operator in Scala
Let's say you have a need for doing something like this
val x = f("something")
val y = g(x)
val z = h(y)
This is also equivalent to saying:
val z = h(g(f("something"))) // Ugly
You can rewrite the above like this:
val z = (f andThen g andThen h)("something") // Better
OR if you want to reuse the composed function again:
// Much Better
val newFunc = f andThen g andThen h
val z = newFunc("something")
val a = newFunc("else)