refinery v0.2.0 Refinery

Refinery is an Elixir DSL for defining refinement types.

Definitions

A refinement is a unary predicate function: a function that accepts one argument and returns a boolean.

A type is a named, ordered collection of refinements that describe a set of Elixir terms.

An object is a collection of types, similar to an Elixir struct. Each key in an object has a type. An object can also have refinements that accept the object as an argument.

An algebra is a grouping of related types and objects.

Link to this section Summary

Link to this section Functions

Link to this function cast(term, list)
cast(any(), [{:as, module()}]) :: {:ok, any()} | {:error, any()}
Link to this macro defalgebra(name, list) (macro)
defalgebra(module(), [{:do, Macro.t()}]) :: Macro.t()
Link to this macro defobject(name, fields, list) (macro)
defobject(module(), [{atom(), module()}], [{:do, Macro.t()}]) :: Macro.t()
Link to this macro deftype(name, list) (macro)
deftype(module(), [{:do, Macro.t()}]) :: Macro.t()
Link to this macro refine(local_or_remote_fun) (macro)
refine((any() -> boolean())) :: Macro.t()