它让你把一层层的逆着你的思维的函数调用变成了更直观的表现,比如说我们常常这么写代码:
IO.puts(tabularize(to_map(Store.get_host(host))))
# 或者
list_data = Store.get_host(host)
map = to_map(list)
formatted_output = tabularize(map)
IO.puts(formatted_output)
这样的代码在Elixir中可以被写成:
host
|> Store.get_host
|> to_map
|> tabularize
|> IO.puts
非常符合人的思考过程,1步步的执行。