alpaca
alpaca copied to clipboard
Auto-imported pipe operator
Hello!
I'd like to suggest adding an automatically imported pipe-forward function to Alpaca.
let value |> func =
func value
This would allow us to chain functions to avoid some unneeded variables while still writing in an easy-to-read left-to-right/top-to-bottom style. :)
"123"
|> string.chars
|> list.reverse
|> string.join "-"
-- "3-2-1"
IIRC @lepoetemaudit has implemented this somewhere as a proof of concept. Might fit in with @Licenser's ideas in #184, whatever form that takes?
<3 I'm still in love with the idea if implementing part of alpaca in alpaca it feels so elegant and easy to reason about :D