Skip to content
/ newt Public

A low-cost NewType pattern implementation for Elixir

License

Notifications You must be signed in to change notification settings

jwilger/newt

Repository files navigation

Newt

A low-cost abstraction implementing the NewType pattern in Elixir

There is no way (currently) to define zero-cost NewTypes in Elixir (like you can in Rust, Haskell, F#, etc.) because Elixir is dynamically typed. However, this library provides a low-cost abstraction that allows you to define NewTypes in Elixir with minimal boilerplate.

Installation

If available in Hex, the package can be installed by adding newt to your list of dependencies in mix.exs:

def deps do
  [
    {:newt, "~> 0.1.0"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/newt.

About

A low-cost NewType pattern implementation for Elixir

Resources

License

Stars

Watchers

Forks

Packages

No packages published