Enum.zipwith(enumerable1, enumerable2, fun)

125 views
Skip to first unread message

Ricky Han

unread,
May 21, 2017, 9:22:54 PM5/21/17
to elixir-lang-core
This function is very handy and should not be composed ad hoc because it is an abstraction for binary function application. In Haskell and Python functools it's a first class function

Peter Hamilton

unread,
May 21, 2017, 9:26:28 PM5/21/17
to elixir-lang-core

Stream.zip and Enum.map are pretty good here.

What might be missing is a function that takes a tuple and applies a function to its elements.


On Sun, May 21, 2017, 6:22 PM Ricky Han <ricky...@gmail.com> wrote:
This function is very handy and should not be composed ad hoc because it is an abstraction for binary function application. In Haskell and Python functools it's a first class function

--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/541f9c0d-2fad-4bda-a4f1-279725844566%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

OvermindDL1

unread,
May 22, 2017, 10:27:45 AM5/22/17
to elixir-lang-core
Yeah I implemented one that wraps a compilation environment as well, it takes the environment and two enumerables and calls the callback with the environment and each enumerable element accepting the updates environment and mapped value back out, it is not hard to build manually but is something useful:

Reply all
Reply to author
Forward
0 new messages