Skip to content

Instantly share code, notes, and snippets.

@gaustin
Created August 23, 2016 20:26
Show Gist options
  • Select an option

  • Save gaustin/d8abd5d1e599e3fbd053d8bff531e8d2 to your computer and use it in GitHub Desktop.

Select an option

Save gaustin/d8abd5d1e599e3fbd053d8bff531e8d2 to your computer and use it in GitHub Desktop.

Revisions

  1. gaustin created this gist Aug 23, 2016.
    5 changes: 5 additions & 0 deletions erlixir_types.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    * 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)