Skip to content

Instantly share code, notes, and snippets.

@gaustin
Created August 23, 2016 20:26
Show Gist options
  • Save gaustin/d8abd5d1e599e3fbd053d8bff531e8d2 to your computer and use it in GitHub Desktop.
Save gaustin/d8abd5d1e599e3fbd053d8bff531e8d2 to your computer and use it in GitHub Desktop.
Grant's self-correction on Erlixir compile time checks
  • The compiler verifies the arity and name of calls within a module.
  • The compiler cannot verify the same across modules as you can dynamically load new code.
  • You can use a tool called dialyzer to add compile time type checks manually. Tutorial: http://learningelixir.joekain.com/elixir-type-safety/
  • Erlixir = is a matching operator and not your usual assignment. Some fun examples along with the pin operator: https://elixirschool.com/lessons/basics/pattern-matching/
  • By extension defining your own record types and doing judicious pattern matching can help provide some runtime type safety. (In that things explode instead of doing nonsense)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment