Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-imported pipe operator #232

Open
lpil opened this issue Jan 6, 2018 · 2 comments
Open

Auto-imported pipe operator #232

lpil opened this issue Jan 6, 2018 · 2 comments

Comments

@lpil
Copy link
Contributor

lpil commented Jan 6, 2018

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"
@j14159
Copy link
Collaborator

j14159 commented Jan 6, 2018

IIRC @lepoetemaudit has implemented this somewhere as a proof of concept. Might fit in with @Licenser's ideas in #184, whatever form that takes?

@Licenser
Copy link
Contributor

Licenser commented Jan 6, 2018

<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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants