News for hackers. Stuff that matters.
Re:Erlangers, Use Labels by geocar on Thursday December 08, 2016 @11:08AM (#13131216)
> PS: Having only dabbled in Erlang, to me the real problem exposed by those examples is the lack of a combined lambda/case,

All lambda in Erlang is case:

    do_whatever(Keys, SomeParameter) ->
      Lookups = lists:map(fun external_lookup/1, Keys),
      lists:foreach(fun
        ({ok, V}) -> do_side_effecty_thing(V, SomeParameter);
        ({error, R}) -> report_some_failure(R)
      end, Lookups).
Re:Erlangers, Use Labels by strmpnk on Thursday December 08, 2016 @08:59PM (#13136089)
I came away with a similar reaction, but there is no need to map separately first: https://news.ycombinator.com/item?id=13136056

Sometimes I do wish Erlang had something like F#'s active patterns because it'd make this sort of thing trivial to add to standard pattern expressions. Maybe someday I'll figure out how to add it myself.

Re:Erlangers, Use Labels by chriswarbo on Thursday December 08, 2016 @11:51AM (#13131689)
Ah, sorry you're right; I mustn't have played with Erlang enough to fade out the punctuation (unlike Lisp, where https://github.com/tarsius/paren-face can do it for me ;) ).