Skip to content

eksperimental/buildable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Buildable

TODO: Add description

Buildable is a protocol that allows users to build terms that implement this protocol.

The very basic version of any term type can be implemented with only three functions:

  • empty/1: which returns the empty representation of the term;
  • insert/3: which inserts an element into the term;
  • extract/2: which extracts an element out of the term.

There are other two protocols that get automatically implemeneted, based on the fallback implementations for Buildable, which are:

  • Buildable.Collectable: it collects elements into a buildable term. It is analog to Elixir core's Collectable, with a minor improvement.
  • Buildable.Reducible: it reduces the buildable into an element. It is analog to Elixir core's Enumerable.reduce/3.

Installation

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

def deps do
  [
    {:buildable, "~> 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/buildable.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages