Typed_struct

screenshot of Typed_struct

An Elixir library for defining structs with a type without writing boilerplate code.

Overview

TypedStruct is a library for defining structs with a type without writing boilerplate code. It simplifies the process of defining structs in Elixir by allowing users to define the struct, enforced keys, and associated type in a single block. This saves time and reduces the chances of making errors.

Features

  • Simplifies the process of defining structs in Elixir
  • Allows for defining default values for struct keys
  • Enforces keys in the struct
  • Supports nullable fields
  • Provides a plugin interface for extending functionality

Summary

TypedStruct is a library for simplifying the process of defining structs in Elixir. It eliminates the need for writing boilerplate code by allowing users to define the struct, enforced keys, and associated type in a single block. It also provides additional features such as supporting default values, enforcing keys, and allowing for nullable fields. The library can be easily installed and used in Elixir projects, making it a valuable tool for developers.