Folks, I’ve made a Domo library adding new/1
constructor function to a struct that automatically checks conformance to the struct’s type.
The library includes the custom compiler that works right after Elixir in the chain to prepare pattern matchings.
Library usage looks like the following:
defmodule Foo do
use Domo
defstruct [:title]
@type t :: %__MODULE__{title: String.t()}
end
Foo.new(title: :hello)
** (ArgumentError) the following values should have types defined for fields of the Foo struct:
* Invalid value :hello for field :title of %Foo{}. Expected the value matching the <<_::_*8>> type.
I’m looking for the codebases with lots of structs to check the compilation times without/with use Domo
in structures via the following command.
mix deps.compile && mix clean && time mix compile
Can you, please, share if you know one or two open-source projects that has as many structs with defined @type t()
as possible?
P.S. Is it an absurd idea to ask you to test on a proprietary codebase? Please, DM if you can do such a measurement; I can send concrete steps in reply