Hello,

In the same sense as Enum.filter_map/3, Enum.map_join/3, I propose 
Enum.find_map/4 (or Enum.find_transform/4).
Right now you would do something like

foo = 
  Enum.find list, nil, fn item -> some_check(item) end
  |> if(foo, do: foo.bar)

With Enum.find_map you could do something like this

foo = Enum.find list, nil, fn item -> some_check(item) end, fn item -> Map.
get item, :bar end

This way you don't have to check if Enum.find actually found something 
before transforming it.

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/8d31a0c3-1902-480b-aeb7-38182726c884%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to