Elixir: Clarify documentation for Task.async_stream/5

Created on 14 Jan 2017  路  2Comments  路  Source: elixir-lang/elixir

Environment

  • Elixir & Erlang versions (elixir -v):

    Erlang/OTP 18 [erts-7.3] [source] [64-bit] [async-threads:10] [hipe] [kernel-poll:false]
    
    Elixir 1.4.0
    
  • Operating system:

    Debian GNU/Linux 8.5 (jessie)

Current behavior

The documentation for Task.async_stream/5 says:

tasks.ex:288:
Each item will be appended to the given args and processed by its own task.

And I simply guessed each item in the enumerable will be _appended_ so that the item becomes the _last_ item of args. But when I actually tried this function, I saw the item had been passed as the first argument to the given function, and it makes me a little bit confused.

Expected behavior

I am quite new to functional programming languages, and the word "appending" may have different meaning in this world. But whether it's intended or not, I think this still needs to be clarified by using the opposite word, or by adding some additional explanation.

Most helpful comment

Oops, the documentation is wrong. Such a small but confusing mistake. I will fix it in master and v1.4, thank you for reporting! :heart:

All 2 comments

Oops, the documentation is wrong. Such a small but confusing mistake. I will fix it in master and v1.4, thank you for reporting! :heart:

Thank you!

Was this page helpful?
0 / 5 - 0 ratings