News for hackers. Stuff that matters.
Re:Changelog for Elixir v1.11 by Kaze404 on Saturday September 12, 2020 @11:40AM (#24453267)
I've been using Dialyzer and it works well enough most of the time. Maybe the Elm compiler spoiled me, but when Dialyzer tells me "this pattern will never match" and not offer me tools to fix it, it's very frustrating. I'm not sure if it's possible, but it would be nice to have an action to autocomplete missing patterns like in Elm / Rust.

That said, I'll take a look at Gleam. Thank you

Re:Changelog for Elixir v1.11 by elcritch on Saturday September 12, 2020 @03:34PM (#24454898)
Dialyzer messages can be pretty obtuse. Usually I take it as a cue to just re-read the function and it's often somewhat clear where the problem lies due to immutability (not always though).

Another trick I'll do, is to use (abuse) pattern matching:

    def foo(%SomeStruct{} = arg, value) when is_integer(value) ...
That also helps Dialyzer narrow down possibilities too and will blow up on runtime.

If you use VSCode, the ElixirLS module will auto-suggest @spec's for your functions.

Re:Changelog for Elixir v1.11 by jswny on Saturday September 12, 2020 @11:59AM (#24453381)
Yeah the big problems with Dialyzer are that it can be slow at times and that the error messages are not great. However, a lot of the error messages are the same esoteric messages, and you can get used to debugging them when you know what they are trying to call out.