-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Description
% iex
Erlang/OTP 19 [erts-8.2] [source-fbd2db2] [64-bit] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false]
Interactive Elixir (1.4.0) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> [1] |> Stream.concat([2]) |> Stream.take(1) |> Stream.transform(0, fn e, a -> {[e], a} end) |> Enum.to_list
[1]
iex(2)> [1] |> Stream.take(1) |> Stream.concat([2]) |> Stream.transform(0, fn e, a -> {[e], a} end) |> Enum.to_list
** (TryClauseError) no try clause matching: {:suspended, [2, 1], #Function<20.36862645/1 in Stream.do_list_transform/9>}
(elixir) lib/stream.ex:784: Stream.do_transform/8
(elixir) lib/enum.ex:1776: Enum.reverse/2
(elixir) lib/enum.ex:2528: Enum.to_list/1
iex(2)>
Environment
Elixir 1.4.0
Linux 3.13.0-85-generic #129-Ubuntu SMP x86_64 GNU/Linux
Current behavior
The second expression (iex(2)
) raises an error.
Expected behavior
The result of the second expression (iex(2)
) should be the same as that of the first expression ( iex(1)
)[1, 2]
.