Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Enum.map(&String.to_integer/1)

vs

.map(&:to_i)

To me the latter is no less clear so yeah, substantially more.

For context I write Elixir once a week and Ruby once a decade. In particular in this case elixir’s (and erlang’s) arity disambiguation (the slash) seems like unhelpful noise. Enum.map only accepts single-arity functions so it seems weird to me that the language couldn't figure that out for me.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: