ts_access v0.2.0 TsAccess

Module that when added as before compile module to module that is using typedstruct, will generate getters and setters for field's of defined struct. Generated functions will also have walid specs so dialyzer should report when setters/getters are used with wrong types

EXAMPLES

If we have struct

defmodule Example do
  @before_compile TsAccess
  use TypeStruct

  typedstruct do
    field(:name, :string)
  end
end

Then it will generate:

  • Example.name/1 returning name
  • Example.name/2 that return struct with updated name