It would probably be best to post this on either the mailing list OR the forum, but not both. Many people use both and having the discussion happen in 2 places is not supre helpful.
On Saturday, September 10, 2016 at 8:05:05 AM UTC-4, Paul Balomiri wrote: > > Hi, > > Today i banged my head against this one : > > iex(13)> [[true,false],[false],[true]]|>Stream.filter(fn([x|tail])-> > IO.inspect([filter: x]); x end) |>Stream.take(1) |> Stream.flat_map(fn(x)-> > IO.inspect([flat_map: x]); x end) |> Enum.to_list() > [filter: true] > [flat_map: [true, false]] > [filter: false] > [filter: true] > [true, false] > > > taking away the culprit `Stream.flat_map` prevents the execution of > `Stream.filter`'s function after the first element: > [[true,false],[false],[true]]|>Stream.filter(fn([x|tail])-> > IO.inspect([filter: x]); x end) |>Stream.take(1) |> Enum.to_list() > [filter: true] > [[true, false]] > > It seems to me that this is a bug, but what i find more puzzling is that i > do not know how `Stream.flat_map` has even any influence on the > `Stream.filter` function. > > Did i miss here how `Stream.flat_map` should work or shall file a bug > request? > > Paul > -- You received this message because you are subscribed to the Google Groups "elixir-lang-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-talk+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/3246429b-ec59-4594-ab87-9e26ee18c2b1%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.