12 April 2022

TIL about the differences between Elixir's boolean operators

TIL the difference between Elixir’s “relaxed”/symbolic Boolean operators (||, &&) and their “strict”/word correspondents (and, or).

  1. Relaxed versions do type coercion; strict require exactly true or false
  2. Strict versions are allowed in guards

Relevant docs: