'''
fn x -> !x end
'''
To reject any falsey value. It does seem reasonable, but I dont think it is nearly as readable as 'compact', so I vote nay to this one...
In fact, isn't this a better option? (Or equally good)
'''
def filter(enum, fun \\ fn x -> x end)
'''
Actually I have also thought that a 'unity' or 'itself' function should be part of stdlib, to make this possible as:
'''
list
|> Enum.filter(&itself)
'''
Hiya
I'd like an identity function in Kernel, that's for sure.
I think an identity function being the default argument to filter would be quite nice. I find reject a bit strange, I don't set why it exists when we have filter.
Cheers,
Louis
--
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/06bc7738-3ed9-4a21-9fce-b7eb3fecd600%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/07571247-7dba-4a21-948d-89f7ac335f92%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/8c4a990c-77be-4d00-857b-9a26c59715f9%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/8c4a990c-77be-4d00-857b-9a26c59715f9%40googlegroups.com.
--Bruce Tate
President, RapidRed, LLC
Phone: 512.772.4312
Fax: 512 857-0415
Author of Seven Languages in Seven Weeks, Deploying Rails Applications, From Java to Ruby, Rails: Up and Running, Beyond Java, 6 others.
--
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/CAMp4_igw0oQsX3Q0i8KZ0mZqBMsdsxdzMGtSM-r4eGa7QtS5Yg%40mail.gmail.com.