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

Yeah, this syntax kinda sucks

  fn handle_async_task(message ...) {
    case message {
      Increment(client) -> {
In Erlang to "just call the damn function" I'd write it something like

  handle_cast(R=#message{type=increment}, S) -> work_module:increment(R, S);
  handle_cast(R=#message{type=decrement}, S) -> work_module:decrement(R, S).
Or I'd use maps instead of records.


It looks like Gleam doesn't allow for multiple function heads. That is one of my favorite features of Elixir as it reduces complexity.


Oh that's very sad! That's one of the great features of Elixir/Erlang.

I wonder why they decided to not permit that sort of thing. :(




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

Search: