Union

The basis of all union data types.

This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Documentation

The basis of all union data types.

Union is used basically to share some methods for refining data structures created by this module, derivation being one of them.

Properties

Meta-programming

derive(...derivations)

Allows a function to provide functionality to variants in an union.

Experimental

Source Code

Defined in source/adt/union/union.js at line 222, column 0
{
  /*~
   * type: |
   *   Union . (...(Variant, Union) => Any) => Union
   */
  derive(...derivations) {
    derivations.forEach(derivation => {
      this.variants.forEach(variant => derivation(variant, this));
    });
    return this;
  }
}
Stability
experimental
Licence
MIT
Module
folktale/adt/union/union
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)