Powered by AppSignal & Oban Pro
Would you like to see your link here? Contact us

Guards

guards.livemd

Guards

Structs

is_keyword_list = fn keyword_list ->
  Keyword.keyword?(keyword_list)
end

is_keyword_list.(one: 1, two: 2)
IO.inspect("value", label: "LABEL")
defmodule Blueprint do
  defstruct foundation: "concrete", doors: "wooden"

  def draw(house) do
    IO.inspect(house, label: "MY HOUSE")
  end
end

# circle back

# Instance
house1 = %Blueprint{doors: "glass"}
house2 = %Blueprint{}
house3 = %Blueprint{}

# Module
Blueprint.draw(house1)
Blueprint.draw(house2)

# Map.from_struct(house1)

Map.values(house1)

Subtracting Strings

"abc"
"abc"

["a", "b", "c"]
["a", "b", "c"]

["a", "b", "c"] -- ["a"]

'abc' -- 'a'

[?a, ?b, ?c] -- [?a]