Introduce pipe operator |> #862

Merged
ghallak merged 3 commits from ghallak/230 into master 2022-04-12 18:40:32 +09:00
ghallak commented 2022-02-28 19:41:22 +09:00 (Migrated from gitlab.com)

Fixes: #230

Fixes: #230
ghallak commented 2022-02-28 20:17:08 +09:00 (Migrated from gitlab.com)
Runtime tests: https://github.com/ghallak/aeternity/blob/3054792ba66e4086075af9713b064c8eb8d673f9/test/contracts/pipe_operator.aes
ghallak commented 2022-02-28 20:23:25 +09:00 (Migrated from gitlab.com)

For consistency, should this be called pipe operator or reverse application operator? 🤔

For consistency, should this be called pipe operator or reverse application operator? :thinking:
zxq9 commented 2022-04-11 18:56:24 +09:00 (Migrated from gitlab.com)

Created by: radrow

Review: Dismissed

I think it would be nicer to make it behave just like in Elixir, so you could do

[1,2,3,4] |> List.flat_map(x => [x, -x])

Note the "partial" application of flatmap. Specifically, to let autocurry functions if needed (and fully applied). @ghallak @hanssv what do you think?

This could be a scope of another PR though

*Created by: radrow* **Review:** Dismissed I think it would be nicer to make it behave just like in Elixir, so you could do ``` [1,2,3,4] |> List.flat_map(x => [x, -x]) ``` Note the "partial" application of flatmap. Specifically, to let autocurry functions if needed (and fully applied). @ghallak @hanssv what do you think? This could be a scope of another PR though
ghallak commented 2022-04-11 19:10:50 +09:00 (Migrated from gitlab.com)

@radrow You suggestion seems good, but since we don't have partial application currently, this might be done in another PR.

@radrow You suggestion seems good, but since we don't have partial application currently, this might be done in another PR.
zxq9 commented 2022-04-12 01:09:30 +09:00 (Migrated from gitlab.com)

Created by: radrow

Review: Approved

*Created by: radrow* **Review:** Approved
zxq9 commented 2022-04-12 18:31:54 +09:00 (Migrated from gitlab.com)

Created by: hanssv

Review: Approved

*Created by: hanssv* **Review:** Approved
zxq9 commented 2022-04-12 18:40:32 +09:00 (Migrated from gitlab.com)

Merged by: ghallak at 2022-04-12 09:40:32 UTC

*Merged by: ghallak at 2022-04-12 09:40:32 UTC*
Sign in to join this conversation.
No description provided.