Simple Phoenix LiveView App: Markdown show notes How to use Elixir LS with Vim

Announced the Domo library's first release during the lightning talk at the ElixirConf EU Virtual

The library is to model a business domain with type-safe structs and composable tagged tuples.

Now a new valid way to have type-safe structs at the runtime is available:

defmodule Order do
  use Domo

  typedstruct do
    field :id, integer
    field :item, String.t(), default: "mixed fruits"
    field :quantity, float
  end

  # the new!/1 constructor function is generated automatically
end
iex(1)> Order.new!(id: "twenty one", quantity: 20)
** (ArgumentError) Can't construct %Order{...} with new!([id: "twenty one", quantity: 20])
    Unexpected value type for the field :id. The value "twenty one" doesn't match the integer type.
    Unexpected value type for the field :quantity. The value 20 doesn't match the float type.

iex(2)> Order.new!(%{id: 125, item: "banana", quantity: 20.5})      
%Order{id: 125, item: "banana", quantity: 20.5}

It was awesome!

https://hex.pm/packages/domo

https://github.com/IvanRublev/Domo

Please, give it a try, and star on the GitHub if you like it or hate it 😀

ElixirWeekly: The Elixir Community Newsletter, covering community news you easily miss, shared on ElixirStatus and the web, in one email every Thursday.