diff --git a/docs/api/v2.0.0/en/-built-in-.constructor.html b/docs/api/v2.0.0/en/-built-in-.constructor.html index 6254df6..ba0c6c1 100644 --- a/docs/api/v2.0.0/en/-built-in-.constructor.html +++ b/docs/api/v2.0.0/en/-built-in-.constructor.html @@ -8,7 +8,7 @@

Array

Documentation

Module
(built-in)
Platforms
  • ECMAScript
Authors
Authors
    Maintainers
      + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.adt.union.union.constructor-2.html b/docs/api/v2.0.0/en/folktale.adt.union.union.constructor-2.html new file mode 100644 index 0000000..f0f01b2 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.adt.union.union.constructor-2.html @@ -0,0 +1,28 @@ + + + + + constructor + + + + + +

      constructor

      The constructor for the variant

      +

      Signature

      get constructor()

      Documentation

      The constructor for the variant

      +

      Properties

      Source Code

      Defined in source/adt/union/union.js at line 55, column 42
      get constructor() {
      +        return constructor;
      +      }
      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/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.adt.union.union.constructor-3.html b/docs/api/v2.0.0/en/folktale.adt.union.union.constructor-3.html new file mode 100644 index 0000000..f0f01b2 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.adt.union.union.constructor-3.html @@ -0,0 +1,28 @@ + + + + + constructor + + + + + +

      constructor

      The constructor for the variant

      +

      Signature

      get constructor()

      Documentation

      The constructor for the variant

      +

      Properties

      Source Code

      Defined in source/adt/union/union.js at line 55, column 42
      get constructor() {
      +        return constructor;
      +      }
      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/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.adt.union.union.constructor-4.html b/docs/api/v2.0.0/en/folktale.adt.union.union.constructor-4.html new file mode 100644 index 0000000..de708e0 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.adt.union.union.constructor-4.html @@ -0,0 +1,28 @@ + + + + + constructor + + + + + +

      constructor

      The constructor function for this variant.

      +

      Signature

      get constructor()

      Documentation

      The constructor function for this variant.

      +

      Properties

      Source Code

      Defined in source/adt/union/union.js at line 55, column 42
      get constructor() {
      +        return constructor;
      +      }
      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/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.adt.union.union.constructor-5.html b/docs/api/v2.0.0/en/folktale.adt.union.union.constructor-5.html new file mode 100644 index 0000000..de708e0 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.adt.union.union.constructor-5.html @@ -0,0 +1,28 @@ + + + + + constructor + + + + + +

      constructor

      The constructor function for this variant.

      +

      Signature

      get constructor()

      Documentation

      The constructor function for this variant.

      +

      Properties

      Source Code

      Defined in source/adt/union/union.js at line 55, column 42
      get constructor() {
      +        return constructor;
      +      }
      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/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.adt.union.union.constructor-6.html b/docs/api/v2.0.0/en/folktale.adt.union.union.constructor-6.html new file mode 100644 index 0000000..aa9b2c7 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.adt.union.union.constructor-6.html @@ -0,0 +1,28 @@ + + + + + constructor + + + + + +

      constructor

      The constructor for this variant.

      +

      Signature

      get constructor()

      Documentation

      The constructor for this variant.

      +

      Properties

      Source Code

      Defined in source/adt/union/union.js at line 55, column 42
      get constructor() {
      +        return constructor;
      +      }
      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/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.adt.union.union.constructor-7.html b/docs/api/v2.0.0/en/folktale.adt.union.union.constructor-7.html new file mode 100644 index 0000000..aa9b2c7 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.adt.union.union.constructor-7.html @@ -0,0 +1,28 @@ + + + + + constructor + + + + + +

      constructor

      The constructor for this variant.

      +

      Signature

      get constructor()

      Documentation

      The constructor for this variant.

      +

      Properties

      Source Code

      Defined in source/adt/union/union.js at line 55, column 42
      get constructor() {
      +        return constructor;
      +      }
      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/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.adt.union.union.constructor-8.html b/docs/api/v2.0.0/en/folktale.adt.union.union.constructor-8.html new file mode 100644 index 0000000..aa9b2c7 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.adt.union.union.constructor-8.html @@ -0,0 +1,28 @@ + + + + + constructor + + + + + +

      constructor

      The constructor for this variant.

      +

      Signature

      get constructor()

      Documentation

      The constructor for this variant.

      +

      Properties

      Source Code

      Defined in source/adt/union/union.js at line 55, column 42
      get constructor() {
      +        return constructor;
      +      }
      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/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.adt.union.union.constructor-9.html b/docs/api/v2.0.0/en/folktale.adt.union.union.constructor-9.html new file mode 100644 index 0000000..aa9b2c7 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.adt.union.union.constructor-9.html @@ -0,0 +1,28 @@ + + + + + constructor + + + + + +

      constructor

      The constructor for this variant.

      +

      Signature

      get constructor()

      Documentation

      The constructor for this variant.

      +

      Properties

      Source Code

      Defined in source/adt/union/union.js at line 55, column 42
      get constructor() {
      +        return constructor;
      +      }
      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/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.adt.union.union.constructor.html b/docs/api/v2.0.0/en/folktale.adt.union.union.constructor.html index 4a85f48..f0f01b2 100644 --- a/docs/api/v2.0.0/en/folktale.adt.union.union.constructor.html +++ b/docs/api/v2.0.0/en/folktale.adt.union.union.constructor.html @@ -8,10 +8,10 @@ -

      constructor

      The constructor for this variant.

      -

      Signature

      get constructor()

      Documentation

      The constructor for this variant.

      +

      constructor

      The constructor for the variant

      +

      Signature

      get constructor()

      Documentation

      The constructor for the variant

      Properties

      Source Code

      Defined in source/adt/union/union.js at line 55, column 42
      get constructor() {
               return constructor;
             }
      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/)
      diff --git a/docs/api/v2.0.0/en/folktale.adt.union.union.derive.html b/docs/api/v2.0.0/en/folktale.adt.union.union.derive.html index a8597ae..f24b3f2 100644 --- a/docs/api/v2.0.0/en/folktale.adt.union.union.derive.html +++ b/docs/api/v2.0.0/en/folktale.adt.union.union.derive.html @@ -8,7 +8,7 @@

      derive

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

      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.

      Signature

      derive(...derivations)
      Union . (...(Variant, Union) => Any) => Union

      Documentation

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

      diff --git a/docs/api/v2.0.0/en/folktale.adt.union.union.prototype-1.html b/docs/api/v2.0.0/en/folktale.adt.union.union.prototype-1.html new file mode 100644 index 0000000..b5a0d86 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.adt.union.union.prototype-1.html @@ -0,0 +1,35 @@ + + + + + prototype + + + + + +

      prototype

      A container of methods for the variant.

      +
      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

      A container of methods for the variant.

      +

      Properties

      Fantasy Land

      fantasy-land/equals(that)

      Part of the Setoid instance for Fantasy Land 2.x+. See the equals method for details.

      +

      Meta-programming

      derive(...derivations)

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

      +
      ExperimentalInherited

      Special Values

      get constructor

      The constructor for the variant

      +
      variants

      The variants in the ExecutionState

      +
      ExperimentalInherited

      Testing and Comparing

      hasInstance(value)

      True if the value is any execution state instance.

      +
      ExperimentalInherited

      Variant

      Cancelled()

      The state of a future that has been cancelled.

      +
      ExperimentalInherited
      Pending()

      The state of a future that's still not resolved.

      +
      ExperimentalInherited
      Rejected(reason)

      The state of a future that has been resolved with a failure.

      +
      ExperimentalInherited
      Resolved(value)

      The state of a future that has been successfully resolved with a value.

      +
      ExperimentalInherited

      (Uncategorised)

      equals(value)
      Experimental
      get isCancelled
      Deprecated
      matchWith(pattern)
      Experimental
      toString()
      Experimental

      Source Code

      Defined in source/adt/union/union.js at line 95, column 25
      InternalConstructor.prototype
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/adt/union/union
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.adt.union.union.prototype-2.html b/docs/api/v2.0.0/en/folktale.adt.union.union.prototype-2.html new file mode 100644 index 0000000..42742f4 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.adt.union.union.prototype-2.html @@ -0,0 +1,35 @@ + + + + + prototype + + + + + +

      prototype

      A container of methods for the variant.

      +
      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

      A container of methods for the variant.

      +

      Properties

      Fantasy Land

      fantasy-land/equals(that)

      Part of the Setoid instance for Fantasy Land 2.x+. See the equals method for details.

      +

      Meta-programming

      derive(...derivations)

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

      +
      ExperimentalInherited

      Special Values

      get constructor

      The constructor for the variant

      +
      variants

      The variants in the ExecutionState

      +
      ExperimentalInherited

      Testing and Comparing

      hasInstance(value)

      True if the value is any execution state instance.

      +
      ExperimentalInherited

      Variant

      Cancelled()

      The state of a future that has been cancelled.

      +
      ExperimentalInherited
      Pending()

      The state of a future that's still not resolved.

      +
      ExperimentalInherited
      Rejected(reason)

      The state of a future that has been resolved with a failure.

      +
      ExperimentalInherited
      Resolved(value)

      The state of a future that has been successfully resolved with a value.

      +
      ExperimentalInherited

      (Uncategorised)

      equals(value)
      Experimental
      get isRejected
      Deprecated
      matchWith(pattern)
      Experimental
      toString()
      Experimental

      Source Code

      Defined in source/adt/union/union.js at line 95, column 25
      InternalConstructor.prototype
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/adt/union/union
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.adt.union.union.prototype-3.html b/docs/api/v2.0.0/en/folktale.adt.union.union.prototype-3.html new file mode 100644 index 0000000..3fdffb9 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.adt.union.union.prototype-3.html @@ -0,0 +1,35 @@ + + + + + prototype + + + + + +

      prototype

      A container of methods for the variant.

      +
      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

      A container of methods for the variant.

      +

      Properties

      Fantasy Land

      fantasy-land/equals(that)

      Part of the Setoid instance for Fantasy Land 2.x+. See the equals method for details.

      +

      Meta-programming

      derive(...derivations)

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

      +
      ExperimentalInherited

      Special Values

      get constructor

      The constructor for the variant

      +
      variants

      The variants in the ExecutionState

      +
      ExperimentalInherited

      Testing and Comparing

      hasInstance(value)

      True if the value is any execution state instance.

      +
      ExperimentalInherited

      Variant

      Cancelled()

      The state of a future that has been cancelled.

      +
      ExperimentalInherited
      Pending()

      The state of a future that's still not resolved.

      +
      ExperimentalInherited
      Rejected(reason)

      The state of a future that has been resolved with a failure.

      +
      ExperimentalInherited
      Resolved(value)

      The state of a future that has been successfully resolved with a value.

      +
      ExperimentalInherited

      (Uncategorised)

      equals(value)
      Experimental
      get isResolved
      Deprecated
      matchWith(pattern)
      Experimental
      toString()
      Experimental

      Source Code

      Defined in source/adt/union/union.js at line 95, column 25
      InternalConstructor.prototype
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/adt/union/union
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.adt.union.union.prototype-4.html b/docs/api/v2.0.0/en/folktale.adt.union.union.prototype-4.html new file mode 100644 index 0000000..5e1b202 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.adt.union.union.prototype-4.html @@ -0,0 +1,69 @@ + + + + + prototype + + + + + +

      prototype

      The container for instance methods for Just variants of the Maybe structure.

      +

      Documentation

      The container for instance methods for Just variants of the Maybe structure.

      +

      Properties

      Comparing and testing

      equals(value)

      Performs a deep-comparison of two Maybe values for equality. See adt/union/derivations/equality for details.

      +
      Experimental
      hasInstance(value)

      Tests if an arbitrary value is a Maybe instance.

      +
      Inherited
      get isJust

      True if the value is a Just instance.

      +
      Deprecated

      Constructing

      of(value)

      Constructs a Maybe value that represents a successful value (a Just).

      +
      Inherited

      Constructing funtion

      empty()
      Inherited

      Converting to other types

      toResult(fallbackValue)

      A convenience method for the folktale/conversions/maybe-to-result module.

      +
      ExperimentalInherited
      toValidation(fallbackValue)

      A convenience method for the folktale/conversions/maybe-to-validation module.

      +
      ExperimentalInherited

      Data fields

      get value

      The value contained in a Just instance of the Maybe structure.

      +
      Abstract

      Debugging

      inspect: toString()

      A textual representation for Maybe instances.

      +
      Experimental
      toString()

      A textual representation for Maybe instances.

      +
      Experimental

      Extracting values

      get()

      This method has been renamed to unsafeGet().

      +
      DeprecatedInherited
      getOrElse()

      Extracts the value of a Maybe structure, if it exists (i.e.: is a Just), +otherwise returns the provided default value.

      +
      unsafeGet()

      Extracts the value from a Just structure.

      +

      Fantasy Land

      ap(that)

      Part of the Applicative instance for Fantasy Land 1.x. See the apply method for details.

      +
      fantasy-land/ap(that)

      Part of the Applicative instance for Fantasy Land 2.x+. See the apply method for details.

      +
      fantasy-land/chain(transformation)

      Part of the Monad instance for Fantasy Land 2.x+. See the chain method for details.

      +
      fantasy-land/concat(that)

      Part of the Semigroup instance for Fantasy Land 2.x+. See the concat method for details.

      +
      fantasy-land/equals(that)

      Part of the Setoid instance for Fantasy Land 2.x+. See the equals method for details.

      +
      fantasy-land/map(transformation)

      Part of the Functor instance for Fantasy Land 2.x+. See the map method for details.

      +
      fantasy-land/of(value)

      Part of the Applicative instance for Fantasy Land 2.x+. See the of method for details.

      +

      Meta-programming

      derive(...derivations)

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

      +
      ExperimentalInherited

      Pattern matching

      cata()

      This method has been replaced by matchWith(pattern). cata(morphism) selects +and executes a function for each variant of the Maybe structure.

      +
      Deprecated
      fold()

      Applies a function to each variant of the Maybe structure.

      +
      matchWith(pattern)

      Chooses and executes a function for each variant in the Maybe structure.

      +

      Recovering from errors

      orElse()

      Allows recovering from from failed Maybe values.

      +

      Serialising

      fromJSON(value, parsers = { + [typeName]: adt +}, keysIndicateType = false)

      Parses a JavaScript object previously serialised as aMaybe.toJSON() into a proper Maybe structure.

      +
      ExperimentalInherited
      toJSON()

      Converts a Maybe value to a JavaScript object that may be stored as a JSON value.

      +
      Experimental

      Special values

      get constructor

      The constructor function for this variant.

      +
      variants

      The variants in the Maybe structure.

      +
      Inherited

      Transforming

      apply()

      Transforms a Maybe value using a function contained in another Maybe. As with +.map(), the Maybe values are expected to be Just, and no operation is +performed if any of them is a Nothing.

      +
      chain()

      Transforms an entire Maybe structure with the provided function. As with +.map(), the transformation is only applied if the value is a Just, but +unlike .map() the transformation is expected to return a new Maybe value.

      +
      map()

      Transforms the value inside a Maybe structure with an unary function. Only +transforms values that are successful (Just), and constructs a new Maybe as a +result.

      +

      Variants

      Just(value)

      Constructs a Maybe value that represents a successful value (a Just).

      +
      Inherited
      Nothing()

      Constructs a Maybe value that represents a failure (a Nothing).

      +
      Inherited

      Source Code

      Defined in source/adt/union/union.js at line 95, column 25
      InternalConstructor.prototype
      Stability
      stable
      Licence
      MIT
      Module
      folktale/adt/union/union
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.adt.union.union.prototype-5.html b/docs/api/v2.0.0/en/folktale.adt.union.union.prototype-5.html new file mode 100644 index 0000000..dd09728 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.adt.union.union.prototype-5.html @@ -0,0 +1,68 @@ + + + + + prototype + + + + + +

      prototype

      The container for instance methods for Nothing variants of the Maybe structure.

      +

      Documentation

      The container for instance methods for Nothing variants of the Maybe structure.

      +

      Properties

      Comparing and testing

      equals(value)

      Performs a deep-comparison of two Maybe values for equality. See adt/union/derivations/equality for details.

      +
      Experimental
      hasInstance(value)

      Tests if an arbitrary value is a Maybe instance.

      +
      Inherited
      get isNothing

      True if the value is a Nothing instance.

      +
      Deprecated

      Constructing

      of(value)

      Constructs a Maybe value that represents a successful value (a Just).

      +
      Inherited

      Constructing funtion

      empty()
      Inherited

      Converting to other types

      toResult(fallbackValue)

      A convenience method for the folktale/conversions/maybe-to-result module.

      +
      ExperimentalInherited
      toValidation(fallbackValue)

      A convenience method for the folktale/conversions/maybe-to-validation module.

      +
      ExperimentalInherited

      Debugging

      inspect: toString()

      A textual representation for Maybe instances.

      +
      Experimental
      toString()

      A textual representation for Maybe instances.

      +
      Experimental

      Extracting values

      get()

      This method has been renamed to unsafeGet().

      +
      DeprecatedInherited
      getOrElse()

      Extracts the value of a Maybe structure, if it exists (i.e.: is a Just), +otherwise returns the provided default value.

      +
      unsafeGet()

      Extracts the value from a Just structure.

      +

      Fantasy Land

      ap(that)

      Part of the Applicative instance for Fantasy Land 1.x. See the apply method for details.

      +
      fantasy-land/ap(that)

      Part of the Applicative instance for Fantasy Land 2.x+. See the apply method for details.

      +
      fantasy-land/chain(transformation)

      Part of the Monad instance for Fantasy Land 2.x+. See the chain method for details.

      +
      fantasy-land/concat(that)

      Part of the Semigroup instance for Fantasy Land 2.x+. See the concat method for details.

      +
      fantasy-land/equals(that)

      Part of the Setoid instance for Fantasy Land 2.x+. See the equals method for details.

      +
      fantasy-land/map(transformation)

      Part of the Functor instance for Fantasy Land 2.x+. See the map method for details.

      +
      fantasy-land/of(value)

      Part of the Applicative instance for Fantasy Land 2.x+. See the of method for details.

      +

      Meta-programming

      derive(...derivations)

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

      +
      ExperimentalInherited

      Pattern matching

      cata()

      This method has been replaced by matchWith(pattern). cata(morphism) selects +and executes a function for each variant of the Maybe structure.

      +
      Deprecated
      fold()

      Applies a function to each variant of the Maybe structure.

      +
      matchWith(pattern)

      Chooses and executes a function for each variant in the Maybe structure.

      +

      Recovering from errors

      orElse()

      Allows recovering from from failed Maybe values.

      +

      Serialising

      fromJSON(value, parsers = { + [typeName]: adt +}, keysIndicateType = false)

      Parses a JavaScript object previously serialised as aMaybe.toJSON() into a proper Maybe structure.

      +
      ExperimentalInherited
      toJSON()

      Converts a Maybe value to a JavaScript object that may be stored as a JSON value.

      +
      Experimental

      Special values

      get constructor

      The constructor function for this variant.

      +
      variants

      The variants in the Maybe structure.

      +
      Inherited

      Transforming

      apply()

      Transforms a Maybe value using a function contained in another Maybe. As with +.map(), the Maybe values are expected to be Just, and no operation is +performed if any of them is a Nothing.

      +
      chain()

      Transforms an entire Maybe structure with the provided function. As with +.map(), the transformation is only applied if the value is a Just, but +unlike .map() the transformation is expected to return a new Maybe value.

      +
      map()

      Transforms the value inside a Maybe structure with an unary function. Only +transforms values that are successful (Just), and constructs a new Maybe as a +result.

      +

      Variants

      Just(value)

      Constructs a Maybe value that represents a successful value (a Just).

      +
      Inherited
      Nothing()

      Constructs a Maybe value that represents a failure (a Nothing).

      +
      Inherited

      Source Code

      Defined in source/adt/union/union.js at line 95, column 25
      InternalConstructor.prototype
      Stability
      stable
      Licence
      MIT
      Module
      folktale/adt/union/union
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.adt.union.union.prototype-6.html b/docs/api/v2.0.0/en/folktale.adt.union.union.prototype-6.html new file mode 100644 index 0000000..179cb5d --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.adt.union.union.prototype-6.html @@ -0,0 +1,78 @@ + + + + + prototype + + + + + +

      prototype

      The container for instance methods for Error variants of the Result structure.

      +
      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 container for instance methods for Error variants of the Result structure.

      +

      Properties

      Comparing and testing

      equals(value)

      Performs a deep-comparison of two Result values for equality. See adt/union/derivations/equality for details.

      +
      Experimental
      hasInstance(value)

      Tests if an arbitrary value is a Result instance.

      +
      ExperimentalInherited
      get isError

      True if the value is a Error instance.

      +
      Deprecated

      Constructing

      of(value)

      Constructs a Result holding an Ok value.

      +
      ExperimentalInherited

      Converting to other types

      toMaybe()

      Transforms a Result into a Maybe. Error values are lost in the process.

      +
      ExperimentalInherited
      toValidation()

      Transforms a Result into a Validation.

      +
      ExperimentalInherited

      Data fields

      get value

      The value contained in an Error instance of the Result structure.

      +
      Abstract

      Debugging

      inspect: toString()

      A textual representation for Result instances.

      +
      Experimental
      toString()

      A textual representation for Result instances.

      +
      Experimental

      Extracting values

      get()

      This method has been renamed to unsafeGet().

      +
      DeprecatedInherited
      getOrElse()

      Extracts the value of a Result structure, if it exists (i.e.: is an Ok), +otherwise returns the provided default value.

      +
      Experimental
      merge()

      Returns the value inside of the Result structure, regardless of its state.

      +
      ExperimentalInherited
      unsafeGet()

      Extracts the value from a Result structure.

      +
      Experimental

      Fantasy Land

      ap(that)

      Part of the Applicative instance for Fantasy Land 1.x. See the apply method for details.

      +
      fantasy-land/ap(that)

      Part of the Applicative instance for Fantasy Land 2.x+. See the apply method for details.

      +
      fantasy-land/bimap(f, g)

      Part of the Bifunctor instance for Fantasy Land 2.x+. See the bimap method for details.

      +
      fantasy-land/chain(transformation)

      Part of the Monad instance for Fantasy Land 2.x+. See the chain method for details.

      +
      fantasy-land/concat(that)

      Part of the Semigroup instance for Fantasy Land 2.x+. See the concat method for details.

      +
      fantasy-land/equals(that)

      Part of the Setoid instance for Fantasy Land 2.x+. See the equals method for details.

      +
      fantasy-land/map(transformation)

      Part of the Functor instance for Fantasy Land 2.x+. See the map method for details.

      +
      fantasy-land/of(value)

      Part of the Applicative instance for Fantasy Land 2.x+. See the of method for details.

      +

      Meta-programming

      derive(...derivations)

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

      +
      ExperimentalInherited

      Pattern matching

      fold()

      Applies a function to each case of a Result.

      +
      Experimental
      matchWith(pattern)

      Chooses and executes a function for each variant in the Result structure.

      +
      Experimental

      Recovering from errors

      orElse()

      Allows recovering from Error values with a handler function.

      +
      Experimental
      swap()

      Inverts the context of a Result value such that Errors are transformed into Oks, +and Oks are transformed into Errors. Does not touch the value inside of the +Result.

      +
      Experimental

      Serialising

      fromJSON(value, parsers = { + [typeName]: adt +}, keysIndicateType = false)

      Parses a JavaScript object previously serialised as aResult.toJSON() into a proper Result structure.

      +
      ExperimentalInherited
      toJSON()

      Converts a Result value to a JavaScript object that may be stored as a JSON value.

      +
      Experimental

      Special values

      get constructor

      The constructor for this variant.

      +
      variants

      The variants in the Result structure.

      +
      ExperimentalInherited

      Transforming

      apply()

      Applies the function contained in one Result to the value in another Result. +Application only occurs if both Results are Ok, otherwise keeps the first +Error.

      +
      Experimental
      bimap()

      Transforms each side of a Result with a function, without changing the context +of the computation. That is, Errors will still be Errors, Oks will still be +Oks.

      +
      Experimental
      chain()

      Transforms the value and context of a Result computation with an unary function. +As with .map(), the transformation is only applied if the value is an Ok, +but the transformation is expected a new Result value, which then becomes the +result of the method.

      +
      Experimental
      map()

      Transforms the value inside of a Result structure with an unary function without +changing the context of the computation. That is, Error values continue to be +Error values, and Ok values continue to be Ok values.

      +
      Experimental
      mapError()

      Transforms the value inside an Error without changing the context of the +computation.

      +
      Experimental

      Variants

      Error(value)

      Constructs a Result whose value represents a failure.

      +
      ExperimentalInherited
      Ok(value)

      Constructs a Result whose value represents a success.

      +
      ExperimentalInherited

      (Uncategorised)

      Source Code

      Defined in source/adt/union/union.js at line 95, column 25
      InternalConstructor.prototype
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/adt/union/union
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.adt.union.union.prototype-7.html b/docs/api/v2.0.0/en/folktale.adt.union.union.prototype-7.html new file mode 100644 index 0000000..913e97b --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.adt.union.union.prototype-7.html @@ -0,0 +1,78 @@ + + + + + prototype + + + + + +

      prototype

      The container for instance methods for Ok variants of the Result structure.

      +
      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 container for instance methods for Ok variants of the Result structure.

      +

      Properties

      Comparing and testing

      equals(value)

      Performs a deep-comparison of two Result values for equality. See adt/union/derivations/equality for details.

      +
      Experimental
      hasInstance(value)

      Tests if an arbitrary value is a Result instance.

      +
      ExperimentalInherited
      get isOk

      True if the value is a Ok instance.

      +
      Deprecated

      Constructing

      of(value)

      Constructs a Result holding an Ok value.

      +
      ExperimentalInherited

      Converting to other types

      toMaybe()

      Transforms a Result into a Maybe. Error values are lost in the process.

      +
      ExperimentalInherited
      toValidation()

      Transforms a Result into a Validation.

      +
      ExperimentalInherited

      Data fields

      get value

      The value contained in an Ok instance of the Result structure.

      +
      Abstract

      Debugging

      inspect: toString()

      A textual representation for Result instances.

      +
      Experimental
      toString()

      A textual representation for Result instances.

      +
      Experimental

      Extracting values

      get()

      This method has been renamed to unsafeGet().

      +
      DeprecatedInherited
      getOrElse()

      Extracts the value of a Result structure, if it exists (i.e.: is an Ok), +otherwise returns the provided default value.

      +
      Experimental
      merge()

      Returns the value inside of the Result structure, regardless of its state.

      +
      ExperimentalInherited
      unsafeGet()

      Extracts the value from a Result structure.

      +
      Experimental

      Fantasy Land

      ap(that)

      Part of the Applicative instance for Fantasy Land 1.x. See the apply method for details.

      +
      fantasy-land/ap(that)

      Part of the Applicative instance for Fantasy Land 2.x+. See the apply method for details.

      +
      fantasy-land/bimap(f, g)

      Part of the Bifunctor instance for Fantasy Land 2.x+. See the bimap method for details.

      +
      fantasy-land/chain(transformation)

      Part of the Monad instance for Fantasy Land 2.x+. See the chain method for details.

      +
      fantasy-land/concat(that)

      Part of the Semigroup instance for Fantasy Land 2.x+. See the concat method for details.

      +
      fantasy-land/equals(that)

      Part of the Setoid instance for Fantasy Land 2.x+. See the equals method for details.

      +
      fantasy-land/map(transformation)

      Part of the Functor instance for Fantasy Land 2.x+. See the map method for details.

      +
      fantasy-land/of(value)

      Part of the Applicative instance for Fantasy Land 2.x+. See the of method for details.

      +

      Meta-programming

      derive(...derivations)

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

      +
      ExperimentalInherited

      Pattern matching

      fold()

      Applies a function to each case of a Result.

      +
      Experimental
      matchWith(pattern)

      Chooses and executes a function for each variant in the Result structure.

      +
      Experimental

      Recovering from errors

      orElse()

      Allows recovering from Error values with a handler function.

      +
      Experimental
      swap()

      Inverts the context of a Result value such that Errors are transformed into Oks, +and Oks are transformed into Errors. Does not touch the value inside of the +Result.

      +
      Experimental

      Serialising

      fromJSON(value, parsers = { + [typeName]: adt +}, keysIndicateType = false)

      Parses a JavaScript object previously serialised as aResult.toJSON() into a proper Result structure.

      +
      ExperimentalInherited
      toJSON()

      Converts a Result value to a JavaScript object that may be stored as a JSON value.

      +
      Experimental

      Special values

      get constructor

      The constructor for this variant.

      +
      variants

      The variants in the Result structure.

      +
      ExperimentalInherited

      Transforming

      apply()

      Applies the function contained in one Result to the value in another Result. +Application only occurs if both Results are Ok, otherwise keeps the first +Error.

      +
      Experimental
      bimap()

      Transforms each side of a Result with a function, without changing the context +of the computation. That is, Errors will still be Errors, Oks will still be +Oks.

      +
      Experimental
      chain()

      Transforms the value and context of a Result computation with an unary function. +As with .map(), the transformation is only applied if the value is an Ok, +but the transformation is expected a new Result value, which then becomes the +result of the method.

      +
      Experimental
      map()

      Transforms the value inside of a Result structure with an unary function without +changing the context of the computation. That is, Error values continue to be +Error values, and Ok values continue to be Ok values.

      +
      Experimental
      mapError()

      Transforms the value inside an Error without changing the context of the +computation.

      +
      Experimental

      Variants

      Error(value)

      Constructs a Result whose value represents a failure.

      +
      ExperimentalInherited
      Ok(value)

      Constructs a Result whose value represents a success.

      +
      ExperimentalInherited

      (Uncategorised)

      Source Code

      Defined in source/adt/union/union.js at line 95, column 25
      InternalConstructor.prototype
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/adt/union/union
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.adt.union.union.prototype-8.html b/docs/api/v2.0.0/en/folktale.adt.union.union.prototype-8.html new file mode 100644 index 0000000..7270a34 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.adt.union.union.prototype-8.html @@ -0,0 +1,64 @@ + + + + + prototype + + + + + +

      prototype

      The container for instance methods for Failure variants of the Validation structure.

      +
      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 container for instance methods for Failure variants of the Validation structure.

      +

      Properties

      Combining validations

      apply()

      If successes, applies the function in one Validation to another. Otherwise concatenate the failures.

      +
      concat()

      Combines two validations together such that failures are aggregated.

      +

      Comparing and testing

      equals(value)

      Performs a deep-comparison of two Validation values for equality.

      +
      Experimental
      hasInstance(value)

      Tests if an arbitrary value is a Validation instance.

      +
      ExperimentalInherited
      get isFailure

      True if the value is a Failure instance.

      +
      Deprecated

      Constructing

      of(value)

      Constructs a Validation holding a Success value.

      +
      Inherited

      Converting to other types

      toMaybe()

      Transforms a Validation into a Maybe. Failure values are lost in the process.

      +
      Inherited
      toResult()

      Transforms a Validation into a Reseult.

      +
      Inherited

      Data fields

      get value

      The value contained in an Failure instance of the Validation structure.

      +
      Abstract

      Debugging

      inspect: toString()

      A textual representation for Validation instances.

      +
      Experimental
      toString()

      A textual representation for Validation instances.

      +
      Experimental

      Extracting values

      get()

      This method has been renamed to unsafeGet().

      +
      DeprecatedInherited
      getOrElse()

      Extracts the value of a Validation structure, if it's a Success, otherwise returns the provided default value.

      +
      merge()

      Returns the value inside of the Validation structure, regardless of its state.

      +
      Inherited
      unsafeGet()

      Extracts the value from a Validation structure.

      +

      Fantasy Land

      ap(that)

      Part of the Applicative instance for Fantasy Land 1.x. See the apply method for details.

      +
      fantasy-land/ap(that)

      Part of the Applicative instance for Fantasy Land 2.x+. See the apply method for details.

      +
      fantasy-land/bimap(f, g)

      Part of the Bifunctor instance for Fantasy Land 2.x+. See the bimap method for details.

      +
      fantasy-land/concat(that)

      Part of the Semigroup instance for Fantasy Land 2.x+. See the concat method for details.

      +
      fantasy-land/equals(that)

      Part of the Setoid instance for Fantasy Land 2.x+. See the equals method for details.

      +
      fantasy-land/map(transformation)

      Part of the Functor instance for Fantasy Land 2.x+. See the map method for details.

      +
      fantasy-land/of(value)

      Part of the Applicative instance for Fantasy Land 2.x+. See the of method for details.

      +

      Meta-programming

      derive(...derivations)

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

      +
      ExperimentalInherited

      Pattern matching

      fold()

      Applies a function to each case of a Validation.

      +
      matchWith(pattern)

      Chooses and executes a function for each variant in the Validation structure.

      +
      Experimental

      Recovering from errors

      orElse()

      Allows recovering from Failure values with a handler function.

      +
      swap()

      Inverts the status of a Validation, such that Failures become Successes, and vice-versa.

      +

      Serialising

      fromJSON(value, parsers = { + [typeName]: adt +}, keysIndicateType = false)

      Parses a JavaScript object previously serialised as aValidation.toJSON() into a proper Validation structure.

      +
      ExperimentalInherited
      toJSON()

      Converts a Validation value to a JavaScript object that may be stored as a JSON value.

      +
      Experimental

      Special values

      get constructor

      The constructor for this variant.

      +
      variants

      The variants in the Validation structure.

      +
      ExperimentalInherited

      Transforming

      bimap()

      Transforms each side of a Validation with a function, without changing the status of the validation. That is, failures will still be failures, successes will still be successes.

      +
      map()

      Transforms the successful value inside a Validation structure with an unary function without changing the status of the validation. That is, Success values continue to be Success values, Failure values continue to be Failure values.

      +
      mapFailure()

      Transforms the failure value inside a Validation structure with an unary function without changing the status of the validation. That is, Success values continue to be Success values, Failure values continue to be Failure values.

      +

      Variants

      Failure(value)

      Constructs a Validation whose value represents a failure.

      +
      ExperimentalInherited
      Success(value)

      Constructs a Validation whose value represents a success.

      +
      ExperimentalInherited

      Source Code

      Defined in source/adt/union/union.js at line 95, column 25
      InternalConstructor.prototype
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/adt/union/union
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.adt.union.union.prototype-9.html b/docs/api/v2.0.0/en/folktale.adt.union.union.prototype-9.html new file mode 100644 index 0000000..8a4edfd --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.adt.union.union.prototype-9.html @@ -0,0 +1,64 @@ + + + + + prototype + + + + + +

      prototype

      The container for instance methods for Success variants of the Validation structure.

      +
      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 container for instance methods for Success variants of the Validation structure.

      +

      Properties

      Combining validations

      apply()

      If successes, applies the function in one Validation to another. Otherwise concatenate the failures.

      +
      concat()

      Combines two validations together such that failures are aggregated.

      +

      Comparing and testing

      equals(value)

      Performs a deep-comparison of two Validation values for equality.

      +
      Experimental
      hasInstance(value)

      Tests if an arbitrary value is a Validation instance.

      +
      ExperimentalInherited
      get isSuccess

      True if the value is a Success instance.

      +
      Deprecated

      Constructing

      of(value)

      Constructs a Validation holding a Success value.

      +
      Inherited

      Converting to other types

      toMaybe()

      Transforms a Validation into a Maybe. Failure values are lost in the process.

      +
      Inherited
      toResult()

      Transforms a Validation into a Reseult.

      +
      Inherited

      Data fields

      get value

      The value contained in an Success instance of the Validation structure.

      +
      Abstract

      Debugging

      inspect: toString()

      A textual representation for Validation instances.

      +
      Experimental
      toString()

      A textual representation for Validation instances.

      +
      Experimental

      Extracting values

      get()

      This method has been renamed to unsafeGet().

      +
      DeprecatedInherited
      getOrElse()

      Extracts the value of a Validation structure, if it's a Success, otherwise returns the provided default value.

      +
      merge()

      Returns the value inside of the Validation structure, regardless of its state.

      +
      Inherited
      unsafeGet()

      Extracts the value from a Validation structure.

      +

      Fantasy Land

      ap(that)

      Part of the Applicative instance for Fantasy Land 1.x. See the apply method for details.

      +
      fantasy-land/ap(that)

      Part of the Applicative instance for Fantasy Land 2.x+. See the apply method for details.

      +
      fantasy-land/bimap(f, g)

      Part of the Bifunctor instance for Fantasy Land 2.x+. See the bimap method for details.

      +
      fantasy-land/concat(that)

      Part of the Semigroup instance for Fantasy Land 2.x+. See the concat method for details.

      +
      fantasy-land/equals(that)

      Part of the Setoid instance for Fantasy Land 2.x+. See the equals method for details.

      +
      fantasy-land/map(transformation)

      Part of the Functor instance for Fantasy Land 2.x+. See the map method for details.

      +
      fantasy-land/of(value)

      Part of the Applicative instance for Fantasy Land 2.x+. See the of method for details.

      +

      Meta-programming

      derive(...derivations)

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

      +
      ExperimentalInherited

      Pattern matching

      fold()

      Applies a function to each case of a Validation.

      +
      matchWith(pattern)

      Chooses and executes a function for each variant in the Validation structure.

      +
      Experimental

      Recovering from errors

      orElse()

      Allows recovering from Failure values with a handler function.

      +
      swap()

      Inverts the status of a Validation, such that Failures become Successes, and vice-versa.

      +

      Serialising

      fromJSON(value, parsers = { + [typeName]: adt +}, keysIndicateType = false)

      Parses a JavaScript object previously serialised as aValidation.toJSON() into a proper Validation structure.

      +
      ExperimentalInherited
      toJSON()

      Converts a Validation value to a JavaScript object that may be stored as a JSON value.

      +
      Experimental

      Special values

      get constructor

      The constructor for this variant.

      +
      variants

      The variants in the Validation structure.

      +
      ExperimentalInherited

      Transforming

      bimap()

      Transforms each side of a Validation with a function, without changing the status of the validation. That is, failures will still be failures, successes will still be successes.

      +
      map()

      Transforms the successful value inside a Validation structure with an unary function without changing the status of the validation. That is, Success values continue to be Success values, Failure values continue to be Failure values.

      +
      mapFailure()

      Transforms the failure value inside a Validation structure with an unary function without changing the status of the validation. That is, Success values continue to be Success values, Failure values continue to be Failure values.

      +

      Variants

      Failure(value)

      Constructs a Validation whose value represents a failure.

      +
      ExperimentalInherited
      Success(value)

      Constructs a Validation whose value represents a success.

      +
      ExperimentalInherited

      Source Code

      Defined in source/adt/union/union.js at line 95, column 25
      InternalConstructor.prototype
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/adt/union/union
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.adt.union.union.prototype.html b/docs/api/v2.0.0/en/folktale.adt.union.union.prototype.html index cbc04bd..0b2911c 100644 --- a/docs/api/v2.0.0/en/folktale.adt.union.union.prototype.html +++ b/docs/api/v2.0.0/en/folktale.adt.union.union.prototype.html @@ -8,49 +8,20 @@ -

      prototype

      The container for instance methods for Success variants of the Validation structure.

      -
      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 container for instance methods for Success variants of the Validation structure.

      -

      Properties

      Combining validations

      apply()

      If successes, applies the function in one Validation to another. Otherwise concatenate the failures.

      -
      concat()

      Combines two validations together such that failures are aggregated.

      -

      Comparing and testing

      equals(value)

      Performs a deep-comparison of two Validation values for equality.

      -
      Experimental
      hasInstance(value)

      Tests if an arbitrary value is a Validation instance.

      -
      ExperimentalInherited
      get isSuccess

      True if the value is a Success instance.

      -
      Deprecated

      Constructing

      of(value)

      Constructs a Validation holding a Success value.

      -
      Inherited

      Converting to other types

      toMaybe()

      Transforms a Validation into a Maybe. Failure values are lost in the process.

      -
      Inherited
      toResult()

      Transforms a Validation into a Reseult.

      -
      Inherited

      Data fields

      get value

      The value contained in an Success instance of the Validation structure.

      -
      Abstract

      Debugging

      inspect: toString()

      A textual representation for Validation instances.

      -
      Experimental
      toString()

      A textual representation for Validation instances.

      -
      Experimental

      Extracting values

      get()

      This method has been renamed to unsafeGet().

      -
      DeprecatedInherited
      getOrElse()

      Extracts the value of a Validation structure, if it's a Success, otherwise returns the provided default value.

      -
      merge()

      Returns the value inside of the Validation structure, regardless of its state.

      -
      Inherited
      unsafeGet()

      Extracts the value from a Validation structure.

      -

      Fantasy Land

      ap(that)

      Part of the Applicative instance for Fantasy Land 1.x. See the apply method for details.

      -
      fantasy-land/ap(that)

      Part of the Applicative instance for Fantasy Land 2.x+. See the apply method for details.

      -
      fantasy-land/bimap(f, g)

      Part of the Bifunctor instance for Fantasy Land 2.x+. See the bimap method for details.

      -
      fantasy-land/concat(that)

      Part of the Semigroup instance for Fantasy Land 2.x+. See the concat method for details.

      -
      fantasy-land/equals(that)

      Part of the Setoid instance for Fantasy Land 2.x+. See the equals method for details.

      -
      fantasy-land/map(transformation)

      Part of the Functor instance for Fantasy Land 2.x+. See the map method for details.

      -
      fantasy-land/of(value)

      Part of the Applicative instance for Fantasy Land 2.x+. See the of method for details.

      +

      prototype

      A container of methods for the variant.

      +
      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

      A container of methods for the variant.

      +

      Properties

      Fantasy Land

      fantasy-land/equals(that)

      Part of the Setoid instance for Fantasy Land 2.x+. See the equals method for details.

      Meta-programming

      derive(...derivations)

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

      -
      ExperimentalInherited

      Pattern matching

      fold()

      Applies a function to each case of a Validation.

      -
      matchWith(pattern)

      Chooses and executes a function for each variant in the Validation structure.

      -
      Experimental

      Recovering from errors

      orElse()

      Allows recovering from Failure values with a handler function.

      -
      swap()

      Inverts the status of a Validation, such that Failures become Successes, and vice-versa.

      -

      Serialising

      fromJSON(value, parsers = { - [typeName]: adt -}, keysIndicateType = false)

      Parses a JavaScript object previously serialised as aValidation.toJSON() into a proper Validation structure.

      -
      ExperimentalInherited
      toJSON()

      Converts a Validation value to a JavaScript object that may be stored as a JSON value.

      -
      Experimental

      Special values

      get constructor

      The constructor for this variant.

      -
      variants

      The variants in the Validation structure.

      -
      ExperimentalInherited

      Transforming

      bimap()

      Transforms each side of a Validation with a function, without changing the status of the validation. That is, failures will still be failures, successes will still be successes.

      -
      map()

      Transforms the successful value inside a Validation structure with an unary function without changing the status of the validation. That is, Success values continue to be Success values, Failure values continue to be Failure values.

      -
      mapFailure()

      Transforms the failure value inside a Validation structure with an unary function without changing the status of the validation. That is, Success values continue to be Success values, Failure values continue to be Failure values.

      -

      Variants

      Failure(value)

      Constructs a Validation whose value represents a failure.

      -
      ExperimentalInherited
      Success(value)

      Constructs a Validation whose value represents a success.

      -
      ExperimentalInherited

      Source Code

      Defined in source/adt/union/union.js at line 95, column 25
      InternalConstructor.prototype
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/adt/union/union
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      +
      ExperimentalInherited

      Special Values

      get constructor

      The constructor for the variant

      +
      variants

      The variants in the ExecutionState

      +
      ExperimentalInherited

      Testing and Comparing

      hasInstance(value)

      True if the value is any execution state instance.

      +
      ExperimentalInherited

      Variant

      Cancelled()

      The state of a future that has been cancelled.

      +
      ExperimentalInherited
      Pending()

      The state of a future that's still not resolved.

      +
      ExperimentalInherited
      Rejected(reason)

      The state of a future that has been resolved with a failure.

      +
      ExperimentalInherited
      Resolved(value)

      The state of a future that has been successfully resolved with a value.

      +
      ExperimentalInherited

      (Uncategorised)

      equals(value)
      Experimental
      get isPending
      Deprecated
      matchWith(pattern)
      Experimental
      toString()
      Experimental

      Source Code

      Defined in source/adt/union/union.js at line 95, column 25
      InternalConstructor.prototype
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/adt/union/union
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.adt.union.union.union.html b/docs/api/v2.0.0/en/folktale.adt.union.union.union.html index e0e9759..bb41aa8 100644 --- a/docs/api/v2.0.0/en/folktale.adt.union.union.union.html +++ b/docs/api/v2.0.0/en/folktale.adt.union.union.union.html @@ -2,31 +2,460 @@ - Union + union -

      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 189, column 0
      {
      -  /*~
      -   * type: |
      -   *   Union . (...(Variant, Union) => Any) => Union
      -   */
      -  derive(...derivations) {
      -    derivations.forEach(derivation => {
      -      this.variants.forEach(variant => derivation(variant, this));
      +    

      union

      Constructs a tagged union data structure.

      +
      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.

      Signature

      union(typeId, patterns)
      (String, Object (Array String)) => Union

      Documentation

      Constructs a tagged union data structure.

      +

      Using the adt/union module:

      +
      const union = require('folktale/adt/union/union');
      +
      +var List = union('List', {
      +  Nil(){ },
      +  Cons(value, rest) {
      +    return { value, rest };
      +  }
      +});
      +
      +var { Nil, Cons } = List;
      +
      +Cons('a', Cons('b', Cons('c', Nil())));
      +// ==> { value: 'a', rest: { value: 'b', ..._ }}
      +

      Why use tagged unions?

      +

      Data modelling is a very important part of programming, directly +affecting things like correctness and performance. Folktale is +in general mostly interested in correctness, and providing tools +for achieving that.

      +

      When modelling data in a program, there are several different +choices that one must make in an attempt to capture the rules of +how that data is manipulated and what they represent. Data modeling +tends to come in three different concepts:

      +
        +
      • Scalars represent concepts that have only one atomic +value at a time. This value makes sense on its own, and can't +be divided into further concepts. Examples of this are numers, +strings, etc.

        +
      • +
      • Product represent bigger concepts that are made out of +possibly several smaller concepts, each of which is independent +of each other, and always present. An object that contains a +person's name and age is an example of a product, arrays +are another example.

        +
      • +
      • Unions represent one of out of many concepts, at any given +time. JS doesn't have many data structures that capture the idea +of a union, but there are many cases where this happens in a +codebase:

        +
          +
        • Reading a file may either give you the data in that +file or an error object;

          +
        • +
        • Accessing a property in an object may either give you the +value or undefined;

          +
        • +
        • Querying a database may give you a connection error (maybe +we weren't able to contact the database), a query error +(maybe the query wasn't well formed), a "this value isn't +here" response, or the value you want.

          +
        • +
        +
      • +
      +

      Out of these, you're probably already familiar with products and scalars, +because they're used everywhere in JavaScript, but maybe you're not +familiar with unions, since JavaScript doesn't have many of them built-in.

      +

      For example, when reading a file in Node, you have this:

      +
      fs.readFile(filename, (error, value) => {
      +  if (error != null) {
      +    handleError(error);
      +  } else {
      +    handleSuccess(value);
      +  }
      +});
      +

      The callback function receives two arguments, error and value, but +only one of them may ever be present at any given time. If you have a +value, then error must be null, and if you have an error, then value +must be null. Nothing in the representation of this data tells you +that, or forces you to deal with it like that.

      +

      If you compare it with an API like fetch, where you get a Promise +instead, many of these problems are solved:

      +
      fetch(url).then(
      +  (response) => handleSuccess(response),
      +  (error)    => handleError(error)
      +);
      +

      Here the result of fetch can be either a response or an error, like in +the readFile example, but the only way of getting to that value is +through the then function, which requires you to define separate branches +for handling each case. This way it's not possible to forget to deal with +one of the cases, or make mistakes in the branching condition, such as +if (error == null) { handleError(...) } — which the first version of +this documentation had, in fact.

      +

      Modelling data with adt/union

      +

      So, properly modelling your data helps making sure that a series of errors +can't ever occurr in your program, which is great as you have to deal with +less problems, but how does adt/union help you in that?

      +

      A simple failure case

      +

      To answer this question let's consider a very simple, everyday problem: you +have a function that can return any value, but it can also fail. How do you +differentiate failure from regular values?

      +
      const find = (predicate, items) => {
      +  for (let i = 0; i < items.length; ++i) {
      +    const item = items[i];
      +    if (predicate(item))  return item;
      +  }
      +  return null;
      +};
      +

      The example above returns the item if the predicate matches anything, or null +if it doesn't. But null is also a valid JavaScript value:

      +
      find(x => true, [1, 2, 3]);    // ==> 1
      +find(x => false, [1, 2, 3]);   // ==> null
      +find(x => true, [null, 1, 2]); // ==> null
      +

      Now, there isn't a way of differentiating failure from success if your arrays +have a null value. One could say "this function works for arrays without +nulls", but there isn't a separate type that can enforce those guarantees +either. This confusing behaviour opens the door for bugs that are very +difficult to find, since they're created way before they hit the find +function.

      +

      A more practical approach is to return something that can't be in the array. +For example, if we return an object like: { found: Bool, value: Any }, then +we don't run into this issue:

      +
      const find2 = (predicate, items) => {
      +  for (let i = 0; i < items.length; ++i) {
      +    const item = items[i];
      +    if (predicate(item))  return { found: true, value: item };
      +  }
      +  return { found: false };
      +};
      +
      +find2(x => true, [1, 2, 3]);    // ==> { found: true, value: 1 }
      +find2(x => false, [1, 2, 3]);   // ==> { found: false }
      +find2(x => true, [null, 1, 2]); // ==> { found: true, value: null }
      +

      We can differentiate between successes and failures now, but in order to +use the value we need to unpack it. Now we have two problems: found and +value aren't entirely related, and we have to create this ad-hoc relationship +through an if statement. That's very easy to get wrong. Another problem is +that nothing forces people to check found before looking at value.

      +

      So, a better solution for this is to use tagged unions and pattern matching:

      +
      const union = require('folktale/adt/union/union');
      +
      +const Maybe = union('Maybe', {
      +  None() { return {} },
      +  Some(value) { return { value } }
      +});
      +
      +const find3 = (predicate, items) => {
      +  for (let i = 0; i < items.length; ++i) {
      +    const item = items[i];
      +    if (predicate(item))  return Maybe.Some(item);
      +  }
      +  return Maybe.None();
      +};
      +
      +find3(x => true, [1, 2, 3]);    // ==> Maybe.Some(1)
      +find3(x => false, [1, 2, 3]);   // ==> Maybe.None()
      +find3(x => true, [null, 1, 2]); // ==> Maybe.Some(null)
      +
      +find3(x => true, [1, 2, 3]).matchWith({
      +  None: ()          => "Not found",
      +  Some: ({ value }) => "Found " + value
      +}); // ==> "Found 1"
      +

      Modelling complex cases

      +

      Let's consider a more complex case. Imagine you're writing a function to +handle communicating with some HTTP API. Like in the case presented in +the previous section, a call to the API may succeed or fail. Unlike the +previous example, here a failure has more information associated with it, +and we can have different kinds of failures:

      +
        +
      • The operation may succeed, and return a value;
      • +
      • The operation may fail:
          +
        • Because it wasn't possible to reach the API (due to a network error, for example);
        • +
        • Because the return value of the API wasn't in the expected format (unable to parse);
        • +
        • Because the API itself returned an error (e.g.: if the request had bad data in it).
        • +
        +
      • +
      +

      A common way of writing this in Node would be like this:

      +
      api.method((error, response) => {
      +  if (error != null) {
      +    if (error.code === "http") {
      +      // handle network failures here
      +    }
      +    if (error.code === "service") {
      +      // handle service failures here
      +    } 
      +  } else {
      +    try {
      +      var data = normalise(response);
      +      // handle success here 
      +    } catch(e) { 
      +      // handle invalid responses here
      +    }
      +  }
      +});
      +

      But again, in this style of programming it's easier to make mistakes that are hard +to catch, since we're assigning meaning through control flow in an ad-hoc manner, +and there's nothing to tell us if we've got it wrong. It's also harder to abstract, +because we can't capture these rules as data, so we have to add even more special +control flow structures to handle the abstractions.

      +

      Let's model it as a tagged union instead. We could make a single data structure +that captures all 4 possible results, and that would be a reasonable way of modelling +this. But on the other hand, we wouldn't be able to talk about failures in general, +because this forces us to handle each failure case independently. Instead we'll have +two tagged unions:

      +
      const union = require('folktale/adt/union/union');
      +
      +const Result = union('Result', {
      +  Ok(value) {
      +    return { value }; 
      +  },
      +  Error(reason) {
      +    return { reason };
      +  }
      +});
      +
      +const APIError = union('APIError', {
      +  NetworkError(error){
      +    return { error };
      +  },
      +  ServiceError(code, message) {
      +    return { code, message };
      +  },
      +  ParsingError(error, data) {
      +    return { error, data };
      +  }
      +});
      +

      Then we can construct these values in the API, and make sure people will handle +all cases when using it:

      +
      function handleError(error) {
      +  error.matchWith({
      +    NetworkError: ({ error }) => { ... },
      +    ServiceError: ({ code, message }) => { ... },
      +    ParsingError: ({ error, data }) => { ... }
      +  })
      +}
      +
      +api.method(response => {
      +  response.matchWith({
      +    Error: ({ reason }) => handleError(reason),
      +    Ok:    ({ value })  => { ... }
      +  })
      +});
      +

      Providing common functionality

      +

      When you're modelling data with unions it's tempting to create a lot of +very specific objects to capture correctly all of the choices that may +exist in a particular domain, but adt/union only gives you construction +and pattern matching, so what if you want your types to have a notion +of equality?

      +

      That's where the concept of derivation comes in. A derivation is a +function that provides a set of common functionality for an union and +its variants. For example, if one wanted to add the notion of equality +to an union, they could derive Equality as follows:

      +
      const union = require('folktale/adt/union/union');
      +const Equality = require('folktale/adt/union/derivations/equality');
      +
      +const Either = union('Either', {
      +  Left(value) { return { value } },
      +  Right(value){ return { value } }
      +}).derive(Equality);
      +

      Note the .derive(Equality) invocation. derive is a method that can +be called at any time on the union to provide new common functionality +to it. In this case, the Equality derivation gives all variants an +equals() method:

      +
      Either.Left(1).equals(Either.Left(1));   // ==> true
      +Either.Left(1).equals(Either.Right(1));  // ==> false
      +Either.Right(1).equals(Either.Right(2)); // ==> false
      +Either.Right(2).equals(Either.Right(2)); // ==> true
      +

      While adt/union provides a set of common derivations (categorised +Derivation in the documentation), one may create their own derivation +functions to use with Folktale's unions. See the Extending unions +section for details.

      +

      Architecture

      +

      The adt/union module approaches this problem in a structural-type-ish way, which +happens to be very similar to how OCaml's polymorphic variants work, and +how different values are handled in untyped languages.

      +

      In essence, calling union with a set of patterns results in the creation +of N constructors, each with a distinct tag.

      +

      Revisiting the previous List union example, when one writes:

      +
      const union = require('folktale/adt/union/union');
      +
      +var List = union('List', {
      +  Nil:  () => {},
      +  Cons: (value, rest) => ({ value, rest })
      +})
      +

      That's roughly equivalent to the idiomatic:

      +
      var List = {};
      +
      +function Nil() { }
      +Nil.prototype = Object.create(List);
      +
      +function Cons(value, rest) {
      +  this.value = value;
      +  this.rest  = rest;
      +}
      +Cons.prototype = Object.create(List);
      +

      The union function takes as arguments a type identifier (which can be any +object, if you want it to be unique), and an object with the variants. Each +property in this object is expected to be a function that returns the +properties that'll be provided for the instance of that variant.

      +

      The given variants are not returned directly. Instead, we return a wrapper +that will construct a proper value of this type, and augment it with the +properties provided by that variant initialiser.

      +

      Reflection

      +

      The adt/union module relies on JavaScript's built-in reflective features first, +and adds a couple of additional fields to this.

      +

      Types and Tags

      +

      The provided type for the union, and the tag provided for the variant +are both reified in the union structure and the constructed values. These +allow checking the compatibility of different values structurally, which +sidesteps the problems with realms.

      +

      The type of the union is provided by the global symbol @@folktale:adt:type:

      +
      const union = require('folktale/adt/union/union');
      +
      +var Id = union('Identity', { Id: () => {} });
      +Id[Symbol.for('@@folktale:adt:type')]
      +// ==> 'Identity'
      +

      The tag of the value is provided by the global symbol @@folktale:adt:tag:

      +
      var List = union('List', {
      +  Nil: () => {},
      +  Cons: (h, t) => ({ h, t })
      +});
      +List.Nil()[Symbol.for('@@folktale:adt:tag')]
      +// ==> 'Nil'
      +

      These symbols are also exported as properties of the union function +itself, so you can use union.typeSymbol and union.tagSymbol instead +of retrieving a symbol instance with the Symbol.for function.

      +

      is-a tests

      +

      Sometimes it's desirable to test if a value belongs to an union or +to a variant. Out of the box the structures constructed by union +provide a hasInstance check that verify if a value is structurally +part of an union structure, by checking the Type and Tag of that value.

      +
      checking if a value belongs to an union:
      +
      const union = require('folktale/adt/union/union');
      +
      +var IdA = union('IdA', { Id: (x) => ({ x }) });
      +var IdB = union('IdB', { Id: (x) => ({ x }) });
      +
      +IdA.hasInstance(IdA.Id(1))  // ==> true
      +IdA.hasInstance(IdB.Id(1))  // ==> false
      +
      checking if a value belongs to a variant:
      +
      const union = require('folktale/adt/union/union');
      +
      +var Either = union('Either', {
      +  Left:  value => ({ value }),
      +  Right: value => ({ value })
      +});
      +var { Left, Right } = Either;
      +
      +Left.hasInstance(Left(1));  // ==> true
      +Left.hasInstance(Right(1)); // ==> false
      +

      Note that if two unions have the same type ID, they'll be considered +equivalent by hasInstance. You may pass an object (like +Symbol('type name')) to data to avoid this, however reference +equality does not work across realms in JavaScript.

      +

      Since all instances inherit from the union and the variant's prototype +it's also possible to use proto.isPrototypeOf(instance) to check +if an instance belongs to an union by reference equality, rather than +structural equality.

      +

      Extending unions

      +

      Because all variants inherit from the union namespace, it's possible +to provide new functionality to all variants by simply adding new +properties to the union:

      +
      const union = require('folktale/adt/union/union');
      +
      +var List = union('List', {
      +  Nil:  () => {},
      +  Cons: (value, rest) => ({ value, rest })
      +});
      +
      +var { Nil, Cons } = List;
      +
      +List.sum = function() {
      +  return this.matchWith({
      +    Nil:  () => 0,
      +    Cons: ({ value, rest }) => value + rest.sum()
      +  });
      +};
      +
      +Cons(1, Cons(2, Nil())).sum();
      +// ==> 3
      +

      A better approach, however, may be to use the derive function from +the union to provide new functionality to every variant. derive accepts +many derivation functions, which are just functions taking a variant and +union, and providing new functionality for that variant.

      +

      If one wanted to define a JSON serialisation for each variant, for example, +they could do so by using the derive functionality:

      +
      function ToJSON(variant, union) {
      +  var { tag, type } = variant;
      +  variant.prototype.toJSON = function() {
      +    var json = { tag: `${type}:${tag}` };
      +    Object.keys(this).forEach(key => {
      +      var value = this[key];
      +      if (value && typeof value.toJSON === "function") {
      +        json[key] = value.toJSON();
      +      } else {
      +        json[key] = value;
      +      }
           });
      -    return this;
      +    return json;
         }
      -}
      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/)
      +} + +var List = union('List', { + Nil: () => {}, + Cons: (value, rest) => ({ value, rest }) +}).derive(ToJSON); + +var { Nil, Cons } = List; + +Nil().toJSON() +// ==> { tag: "List:Nil" } + +Cons(1, Nil()).toJSON() +// ==> { tag: "List:Cons", value: 1, rest: { "tag": "List:Nil" }} +

      Properties

      Supporting objects

      Union

      The basis of all union data types.

      +
      Experimental

      (Uncategorised)

      A Symbol.

      +
      Experimental

      A Symbol.

      +
      Experimental

      Source Code

      Defined in source/adt/union/union.js at line 157, column 0
      (typeId, patterns) => {
      +  const UnionNamespace = Object.create(Union);
      +  const variants       = defineVariants(typeId, patterns, UnionNamespace);
      +
      +  extend(UnionNamespace, variants, {
      +    // This is internal, and we don't really document it to the user
      +    [TYPE]: typeId,
      +
      +    /*~
      +     * type: Array Variant
      +     * module: null
      +     * ~belongsTo: UnionNamespace
      +     */
      +    variants: values(variants),
      +
      +    /*~
      +     * ~belongsTo: UnionNamespace
      +     * module: null
      +     * type: |
      +     *   Union.(Variant) -> Boolean
      +     */
      +    hasInstance(value) {
      +      return Boolean(value)
      +      &&     value[TYPE] === this[TYPE];
      +    }
      +  });
      +
      +  return UnionNamespace;
      +}
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/adt/union/union
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.concurrency.future._execution-state.inspect-2.html b/docs/api/v2.0.0/en/folktale.concurrency.future._execution-state.inspect-2.html new file mode 100644 index 0000000..419c133 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.concurrency.future._execution-state.inspect-2.html @@ -0,0 +1,26 @@ + + + + + toString + + + + + +

      toString

      A textual representation of the state

      +
      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.

      Signature

      toString()
      () => String

      Documentation

      A textual representation of the state

      +

      Properties

      Source Code

      () => variantName
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/concurrency/future/_execution-state
      On This Page
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • @boris-marinov
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.concurrency.future._execution-state.inspect-3.html b/docs/api/v2.0.0/en/folktale.concurrency.future._execution-state.inspect-3.html new file mode 100644 index 0000000..419c133 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.concurrency.future._execution-state.inspect-3.html @@ -0,0 +1,26 @@ + + + + + toString + + + + + +

      toString

      A textual representation of the state

      +
      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.

      Signature

      toString()
      () => String

      Documentation

      A textual representation of the state

      +

      Properties

      Source Code

      () => variantName
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/concurrency/future/_execution-state
      On This Page
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • @boris-marinov
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.concurrency.future._execution-state.inspect.html b/docs/api/v2.0.0/en/folktale.concurrency.future._execution-state.inspect.html index ac79aca..419c133 100644 --- a/docs/api/v2.0.0/en/folktale.concurrency.future._execution-state.inspect.html +++ b/docs/api/v2.0.0/en/folktale.concurrency.future._execution-state.inspect.html @@ -8,7 +8,7 @@

      toString

      A textual representation of the state

      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.

      Signature

      toString()
      () => String

      Documentation

      A textual representation of the state

      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.future._execution-state.rejected.html b/docs/api/v2.0.0/en/folktale.concurrency.future._execution-state.rejected.html index 56e2aa7..915c119 100644 --- a/docs/api/v2.0.0/en/folktale.concurrency.future._execution-state.rejected.html +++ b/docs/api/v2.0.0/en/folktale.concurrency.future._execution-state.rejected.html @@ -8,20 +8,20 @@

      Rejected

      The state of a future that has been resolved with a failure.

      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.

      Signature

      Rejected(reason)

      Documentation

      The state of a future that has been resolved with a failure.

      -

      Static properties

      Debugging

      inspect: toString()

      A textual representation of the state

      -
      Experimental
      prototype

      A container of methods for the variant.

      -
      Experimental
      toString()

      A textual representation of the state

      +

      Static properties

      Debugging

      inspect: toString()

      A textual representation of the state

      +
      Experimental
      prototype

      A container of methods for the variant.

      +
      Experimental
      toString()

      A textual representation of the state

      Experimental

      Special Values

      get constructor

      The constructor for the variant

      Experimental
      get tag

      The internal tag of the variant.

      Experimental
      get type

      The internal type of the variant.

      Experimental

      Testing and Comparing

      hasInstance(value)

      True if the value is an instance of the state.

      Experimental

      Instance (prototype) properties

      Fantasy Land

      fantasy-land/equals(that)

      Part of the Setoid instance for Fantasy Land 2.x+. See the equals method for details.

      Meta-programming

      derive(...derivations)

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

      -
      ExperimentalInherited

      Special Values

      get constructor

      The constructor for the variant

      +
      ExperimentalInherited

      Special Values

      get constructor

      The constructor for the variant

      variants

      The variants in the ExecutionState

      ExperimentalInherited

      Testing and Comparing

      hasInstance(value)

      True if the value is any execution state instance.

      ExperimentalInherited

      Variant

      Cancelled()

      The state of a future that has been cancelled.

      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.future._execution-state.resolved.html b/docs/api/v2.0.0/en/folktale.concurrency.future._execution-state.resolved.html index a94b663..f19f364 100644 --- a/docs/api/v2.0.0/en/folktale.concurrency.future._execution-state.resolved.html +++ b/docs/api/v2.0.0/en/folktale.concurrency.future._execution-state.resolved.html @@ -8,20 +8,20 @@

      Resolved

      The state of a future that has been successfully resolved with a value.

      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.

      Signature

      Resolved(value)

      Documentation

      The state of a future that has been successfully resolved with a value.

      -

      Static properties

      Debugging

      inspect: toString()

      A textual representation of the state

      -
      Experimental
      prototype

      A container of methods for the variant.

      -
      Experimental
      toString()

      A textual representation of the state

      +

      Static properties

      Debugging

      inspect: toString()

      A textual representation of the state

      +
      Experimental
      prototype

      A container of methods for the variant.

      +
      Experimental
      toString()

      A textual representation of the state

      Experimental

      Special Values

      get constructor

      The constructor for the variant

      Experimental
      get tag

      The internal tag of the variant.

      Experimental
      get type

      The internal type of the variant.

      Experimental

      Testing and Comparing

      hasInstance(value)

      True if the value is an instance of the state.

      Experimental

      Instance (prototype) properties

      Fantasy Land

      fantasy-land/equals(that)

      Part of the Setoid instance for Fantasy Land 2.x+. See the equals method for details.

      Meta-programming

      derive(...derivations)

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

      -
      ExperimentalInherited

      Special Values

      get constructor

      The constructor for the variant

      +
      ExperimentalInherited

      Special Values

      get constructor

      The constructor for the variant

      variants

      The variants in the ExecutionState

      ExperimentalInherited

      Testing and Comparing

      hasInstance(value)

      True if the value is any execution state instance.

      ExperimentalInherited

      Variant

      Cancelled()

      The state of a future that has been cancelled.

      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.future._future._future.html b/docs/api/v2.0.0/en/folktale.concurrency.future._future._future.html index 7035647..989a377 100644 --- a/docs/api/v2.0.0/en/folktale.concurrency.future._future._future.html +++ b/docs/api/v2.0.0/en/folktale.concurrency.future._future._future.html @@ -8,7 +8,7 @@

      Future

      Models the eventual result of asynchronous computations.

      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

      Models the eventual result of asynchronous computations.

      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.future._future._listeners.html b/docs/api/v2.0.0/en/folktale.concurrency.future._future._listeners.html index 868b767..e1023c2 100644 --- a/docs/api/v2.0.0/en/folktale.concurrency.future._future._listeners.html +++ b/docs/api/v2.0.0/en/folktale.concurrency.future._future._listeners.html @@ -8,7 +8,7 @@

      _listeners

      A list of visitors to be invoked when the state of the future changes.

      Signature

      get()
      get (Future 'f 's) => Array (DeferredListener 'f 's)

      Documentation

      A list of visitors to be invoked when the state of the future changes.

      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.future._future._state.html b/docs/api/v2.0.0/en/folktale.concurrency.future._future._state.html index 7847251..43d9cc9 100644 --- a/docs/api/v2.0.0/en/folktale.concurrency.future._future._state.html +++ b/docs/api/v2.0.0/en/folktale.concurrency.future._future._state.html @@ -8,7 +8,7 @@

      _state

      The current state of the Future.

      Signature

      get()
      get (Future 'f 's) => ExecutionState 'f 's

      Documentation

      The current state of the Future.

      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.future._future.apply.html b/docs/api/v2.0.0/en/folktale.concurrency.future._future.apply.html index 5d1b2f1..53cf68c 100644 --- a/docs/api/v2.0.0/en/folktale.concurrency.future._future.apply.html +++ b/docs/api/v2.0.0/en/folktale.concurrency.future._future.apply.html @@ -8,7 +8,7 @@

      apply

      Transforms the succesful value of a future by using a function stored in another future.

      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.

      Signature

      value(future)
      (Future 'f 's).(Future 'f (('s) => 's2)) => Future 'f 's2

      Documentation

      Transforms the succesful value of a future by using a function stored in another future.

      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.future._future.bimap.html b/docs/api/v2.0.0/en/folktale.concurrency.future._future.bimap.html index 7e9f5f8..be9e55b 100644 --- a/docs/api/v2.0.0/en/folktale.concurrency.future._future.bimap.html +++ b/docs/api/v2.0.0/en/folktale.concurrency.future._future.bimap.html @@ -8,7 +8,7 @@

      bimap

      Transforms both successful and failure values in a Future, without touching its state.

      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.

      Signature

      value(rejectionTransformation, successTransformation)
      (Future 'f 's).(('f) => 'f2, ('s) => 's2) => Future 'f2 's2

      Documentation

      Transforms both successful and failure values in a Future, without touching its state.

      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.future._future.chain.html b/docs/api/v2.0.0/en/folktale.concurrency.future._future.chain.html index 039fb4b..fd30e8b 100644 --- a/docs/api/v2.0.0/en/folktale.concurrency.future._future.chain.html +++ b/docs/api/v2.0.0/en/folktale.concurrency.future._future.chain.html @@ -8,7 +8,7 @@

      chain

      Transforms a Future's successful value along with its state.

      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.

      Signature

      value(transformation)
      (Future 'f 's).(('s) => Future 's2) => Future 'f 's2

      Documentation

      Transforms a Future's successful value along with its state.

      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.future._future.frompromise.html b/docs/api/v2.0.0/en/folktale.concurrency.future._future.frompromise.html index 53028b7..4e9638a 100644 --- a/docs/api/v2.0.0/en/folktale.concurrency.future._future.frompromise.html +++ b/docs/api/v2.0.0/en/folktale.concurrency.future._future.frompromise.html @@ -8,7 +8,7 @@

      fromPromise

      Converts a Promise to a folktale Future.

      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.

      Signature

      fromPromise(aPromise)
      forall e, v: (Promise v e) => Future e v

      Documentation

      Converts a Promise to a folktale Future.

      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.future._future.inspect.html b/docs/api/v2.0.0/en/folktale.concurrency.future._future.inspect.html index c70533f..cda64c3 100644 --- a/docs/api/v2.0.0/en/folktale.concurrency.future._future.inspect.html +++ b/docs/api/v2.0.0/en/folktale.concurrency.future._future.inspect.html @@ -8,7 +8,7 @@

      inspect

      Returns a textual representation of the Future.

      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.

      Signature

      value()
      (Future 'f 's).() => String

      Documentation

      Returns a textual representation of the Future.

      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.future._future.listen.html b/docs/api/v2.0.0/en/folktale.concurrency.future._future.listen.html index 0f38cf6..b1830d0 100644 --- a/docs/api/v2.0.0/en/folktale.concurrency.future._future.listen.html +++ b/docs/api/v2.0.0/en/folktale.concurrency.future._future.listen.html @@ -8,7 +8,7 @@

      listen

      Adds a visitor to the Future, which will be invoked when the Future's state changes.

      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.

      Signature

      value(pattern)
      (Future 'f 's).(DeferredListener 'f 's) => Future 'f 's

      Documentation

      Adds a visitor to the Future, which will be invoked when the Future's state changes.

      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.future._future.map.html b/docs/api/v2.0.0/en/folktale.concurrency.future._future.map.html index a865e22..bce2f16 100644 --- a/docs/api/v2.0.0/en/folktale.concurrency.future._future.map.html +++ b/docs/api/v2.0.0/en/folktale.concurrency.future._future.map.html @@ -8,7 +8,7 @@

      map

      Transforms the successful value of a Future, without touching its state.

      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.

      Signature

      value(transformation)
      (Future 'f 's).(('s) => 's2) => Future 'f 's2

      Documentation

      Transforms the successful value of a Future, without touching its state.

      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.future._future.maprejected.html b/docs/api/v2.0.0/en/folktale.concurrency.future._future.maprejected.html index 53ce126..2baf71d 100644 --- a/docs/api/v2.0.0/en/folktale.concurrency.future._future.maprejected.html +++ b/docs/api/v2.0.0/en/folktale.concurrency.future._future.maprejected.html @@ -8,7 +8,7 @@

      mapRejected

      Transforms failure values in a Future without touching its state.

      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.

      Signature

      value(transformation)
      (Future 'f 's).(('f) => 'f2) => Future 'f2 's

      Documentation

      Transforms failure values in a Future without touching its state.

      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.future._future.of.html b/docs/api/v2.0.0/en/folktale.concurrency.future._future.of.html index 90b9ab5..5140470 100644 --- a/docs/api/v2.0.0/en/folktale.concurrency.future._future.of.html +++ b/docs/api/v2.0.0/en/folktale.concurrency.future._future.of.html @@ -8,7 +8,7 @@

      of

      Constructs a Future holding a successful value.

      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.

      Signature

      of(value)
      forall a, b:
      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.future._future.recover.html b/docs/api/v2.0.0/en/folktale.concurrency.future._future.recover.html
      index 0259736..035b50a 100644
      --- a/docs/api/v2.0.0/en/folktale.concurrency.future._future.recover.html
      +++ b/docs/api/v2.0.0/en/folktale.concurrency.future._future.recover.html
      @@ -8,7 +8,7 @@
         
         
           
           

      recover

      Transforms a failed future into a new future.

      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.

      Signature

      value(handler)
      (Future 'f 's).(('f) => Future 'f2 's2) => Future 'f2 's

      Documentation

      Transforms a failed future into a new future.

      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.future._future.rejected.html b/docs/api/v2.0.0/en/folktale.concurrency.future._future.rejected.html index 7a2224c..870f182 100644 --- a/docs/api/v2.0.0/en/folktale.concurrency.future._future.rejected.html +++ b/docs/api/v2.0.0/en/folktale.concurrency.future._future.rejected.html @@ -8,7 +8,7 @@

      rejected

      Constructs a future holding a failure value.

      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.

      Signature

      rejected(reason)
      forall a, b: (Future).(a) => Future a b

      Documentation

      Constructs a future holding a failure value.

      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.future._future.swap.html b/docs/api/v2.0.0/en/folktale.concurrency.future._future.swap.html index a2d09ab..262a66e 100644 --- a/docs/api/v2.0.0/en/folktale.concurrency.future._future.swap.html +++ b/docs/api/v2.0.0/en/folktale.concurrency.future._future.swap.html @@ -8,7 +8,7 @@

      swap

      Inverts the state of a Future: successes become failures, failures become successes.

      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.

      Signature

      value()
      (Future 'f 's).() => Future 's 'f

      Documentation

      Inverts the state of a Future: successes become failures, failures become successes.

      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.future._future.topromise.html b/docs/api/v2.0.0/en/folktale.concurrency.future._future.topromise.html index 5f52a2c..d294c34 100644 --- a/docs/api/v2.0.0/en/folktale.concurrency.future._future.topromise.html +++ b/docs/api/v2.0.0/en/folktale.concurrency.future._future.topromise.html @@ -8,7 +8,7 @@

      toPromise

      Converts a Future into a Promise.

      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.

      Signature

      value()
      forall e, v:
      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.future._future.tostring.html b/docs/api/v2.0.0/en/folktale.concurrency.future._future.tostring.html
      index 60d4e73..34c04e1 100644
      --- a/docs/api/v2.0.0/en/folktale.concurrency.future._future.tostring.html
      +++ b/docs/api/v2.0.0/en/folktale.concurrency.future._future.tostring.html
      @@ -8,7 +8,7 @@
         
         
           
           

      toString

      Returns a textual representation of the Future.

      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.

      Signature

      value()
      (Future 'f 's).() => String

      Documentation

      Returns a textual representation of the Future.

      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.future._future.willmatchwith.html b/docs/api/v2.0.0/en/folktale.concurrency.future._future.willmatchwith.html index 6fb5af7..a9a8f48 100644 --- a/docs/api/v2.0.0/en/folktale.concurrency.future._future.willmatchwith.html +++ b/docs/api/v2.0.0/en/folktale.concurrency.future._future.willmatchwith.html @@ -8,7 +8,7 @@

      willMatchWith

      Limited pattern matching for futures.

      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.

      Signature

      value(pattern)
      forall a, b, c, d:
      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.future.html b/docs/api/v2.0.0/en/folktale.concurrency.future.html
      index 47ec6d7..a3f7377 100644
      --- a/docs/api/v2.0.0/en/folktale.concurrency.future.html
      +++ b/docs/api/v2.0.0/en/folktale.concurrency.future.html
      @@ -8,7 +8,7 @@
         
         
           
           

      module folktale/concurrency/future

      A data structure to represent the result of an asynchronous computation.

      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

      A data structure to represent the result of an asynchronous computation.

      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.html b/docs/api/v2.0.0/en/folktale.concurrency.html index e1b0e60..c3b7e55 100644 --- a/docs/api/v2.0.0/en/folktale.concurrency.html +++ b/docs/api/v2.0.0/en/folktale.concurrency.html @@ -8,7 +8,7 @@

      module folktale/concurrency

      Provides tools for managing asynchronous concurrent operations in JavaScript. Task models asynchronous operations with automatic resource management, whereas Future is a simpler alternative to Promise.

      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

      Provides tools for managing asynchronous concurrent operations in JavaScript. Task models asynchronous operations with automatic resource management, whereas Future is a simpler alternative to Promise.

      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.task._task-execution._taskexecution.html b/docs/api/v2.0.0/en/folktale.concurrency.task._task-execution._taskexecution.html index b5a8b27..e70f0ce 100644 --- a/docs/api/v2.0.0/en/folktale.concurrency.task._task-execution._taskexecution.html +++ b/docs/api/v2.0.0/en/folktale.concurrency.task._task-execution._taskexecution.html @@ -8,7 +8,7 @@

      TaskExecution

      Represents the execution of a Task, with methods to cancel it, react to its results, and retrieve its eventual value. TaskExecution objects aren't created diff --git a/docs/api/v2.0.0/en/folktale.concurrency.task._task._task.html b/docs/api/v2.0.0/en/folktale.concurrency.task._task._task.html index f763fc9..54f7398 100644 --- a/docs/api/v2.0.0/en/folktale.concurrency.task._task._task.html +++ b/docs/api/v2.0.0/en/folktale.concurrency.task._task._task.html @@ -8,7 +8,7 @@

      Task

      Tasks model asynchronous processes with automatic resource handling. They are generally constructed with the task function.

      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.

      Signature

      Task(computation)
      forall value, reason:
      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.task._task.and.html b/docs/api/v2.0.0/en/folktale.concurrency.task._task.and.html
      index f967106..990f664 100644
      --- a/docs/api/v2.0.0/en/folktale.concurrency.task._task.and.html
      +++ b/docs/api/v2.0.0/en/folktale.concurrency.task._task.and.html
      @@ -8,7 +8,7 @@
         
         
           
           

      and

      Constructs a new task that awaits both tasks to resolve. The result of the new task is a tuple containing the results of the left and right tasks, if they all succeed, or the first failure if they fail.

      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.

      Signature

      value(that)
      forall e, v1, v2:
      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.task._task.apply.html b/docs/api/v2.0.0/en/folktale.concurrency.task._task.apply.html
      index da147d8..d6f8e16 100644
      --- a/docs/api/v2.0.0/en/folktale.concurrency.task._task.apply.html
      +++ b/docs/api/v2.0.0/en/folktale.concurrency.task._task.apply.html
      @@ -8,7 +8,7 @@
         
         
           
           

      apply

      Applies the function in the left task to the value on the right task. The left task is ran to completion before the right task is started.

      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.task._task.bimap.html b/docs/api/v2.0.0/en/folktale.concurrency.task._task.bimap.html index d92303e..3b76a07 100644 --- a/docs/api/v2.0.0/en/folktale.concurrency.task._task.bimap.html +++ b/docs/api/v2.0.0/en/folktale.concurrency.task._task.bimap.html @@ -8,7 +8,7 @@

      bimap

      Transforms the rejected or resolved values of a Task with a function. The state of the task is not changed.

      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.

      Signature

      value(rejectionTransformation, successTransformation)
      forall e1, e2, v1, v2:
      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.task._task.chain.html b/docs/api/v2.0.0/en/folktale.concurrency.task._task.chain.html
      index 4411755..86aed53 100644
      --- a/docs/api/v2.0.0/en/folktale.concurrency.task._task.chain.html
      +++ b/docs/api/v2.0.0/en/folktale.concurrency.task._task.chain.html
      @@ -8,7 +8,7 @@
         
         
           
           

      chain

      Transforms the value and state of a Task.

      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.

      Signature

      value(transformation)
      forall e, v1, v2:
      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.task._task.map.html b/docs/api/v2.0.0/en/folktale.concurrency.task._task.map.html
      index 0250e9a..0a3bbe2 100644
      --- a/docs/api/v2.0.0/en/folktale.concurrency.task._task.map.html
      +++ b/docs/api/v2.0.0/en/folktale.concurrency.task._task.map.html
      @@ -8,7 +8,7 @@
         
         
           
           

      map

      Transforms the value of a successful task.

      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.

      Signature

      value(transformation)
      forall e, v1, v2:
      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.task._task.maprejected.html b/docs/api/v2.0.0/en/folktale.concurrency.task._task.maprejected.html
      index 759e70d..19ef00e 100644
      --- a/docs/api/v2.0.0/en/folktale.concurrency.task._task.maprejected.html
      +++ b/docs/api/v2.0.0/en/folktale.concurrency.task._task.maprejected.html
      @@ -8,7 +8,7 @@
         
         
           
           

      mapRejected

      Transforms the value of a failed task.

      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.

      Signature

      value(transformation)
      forall e1, e2, v:
      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.task._task.of.html b/docs/api/v2.0.0/en/folktale.concurrency.task._task.of.html
      index 8969e86..7398b07 100644
      --- a/docs/api/v2.0.0/en/folktale.concurrency.task._task.of.html
      +++ b/docs/api/v2.0.0/en/folktale.concurrency.task._task.of.html
      @@ -8,7 +8,7 @@
         
         
           
           

      of

      Constructs a Task that resolves with a successful value.

      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.

      Signature

      of(value)
      forall e, v: (v) => Task e v

      Documentation

      Constructs a Task that resolves with a successful value.

      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.task._task.or.html b/docs/api/v2.0.0/en/folktale.concurrency.task._task.or.html index 7345dd2..cdbbccf 100644 --- a/docs/api/v2.0.0/en/folktale.concurrency.task._task.or.html +++ b/docs/api/v2.0.0/en/folktale.concurrency.task._task.or.html @@ -8,7 +8,7 @@

      or

      Combines two tasks such that the resulting task assimilates the result of the first one to resolve.

      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.task._task.orelse.html b/docs/api/v2.0.0/en/folktale.concurrency.task._task.orelse.html index bd947aa..5ba3707 100644 --- a/docs/api/v2.0.0/en/folktale.concurrency.task._task.orelse.html +++ b/docs/api/v2.0.0/en/folktale.concurrency.task._task.orelse.html @@ -8,7 +8,7 @@

      orElse

      Transforms a failed task's value and state.

      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.

      Signature

      value(handler)
      forall e, e2, v:
      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.task._task.rejected.html b/docs/api/v2.0.0/en/folktale.concurrency.task._task.rejected.html
      index 0a9a8f7..5a5af17 100644
      --- a/docs/api/v2.0.0/en/folktale.concurrency.task._task.rejected.html
      +++ b/docs/api/v2.0.0/en/folktale.concurrency.task._task.rejected.html
      @@ -8,7 +8,7 @@
         
         
           
           

      rejected

      Constructs a Task that resolves with a rejected value.

      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.

      Signature

      rejected(reason)
      forall e, v: (e) => Task e v

      Documentation

      Constructs a Task that resolves with a rejected value.

      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.task._task.run.html b/docs/api/v2.0.0/en/folktale.concurrency.task._task.run.html index 58411e5..27b4be0 100644 --- a/docs/api/v2.0.0/en/folktale.concurrency.task._task.run.html +++ b/docs/api/v2.0.0/en/folktale.concurrency.task._task.run.html @@ -8,7 +8,7 @@

      run

      Executes a Task and returns a TaskExecution object representing the execution.

      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.

      Signature

      value()
      forall e, v: (Task e v).() => TaskExecution e v

      Documentation

      Executes a Task and returns a TaskExecution object representing the execution.

      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.task._task.swap.html b/docs/api/v2.0.0/en/folktale.concurrency.task._task.swap.html index 8968c7a..c448a39 100644 --- a/docs/api/v2.0.0/en/folktale.concurrency.task._task.swap.html +++ b/docs/api/v2.0.0/en/folktale.concurrency.task._task.swap.html @@ -8,7 +8,7 @@

      swap

      Inverts the state of a Task. That is, turns successful tasks into failed ones, and failed tasks into successful ones.

      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.

      Signature

      value()
      forall e, v: (Task e v).() => Task v e

      Documentation

      Inverts the state of a Task. That is, turns successful tasks into failed ones, and failed tasks into successful ones.

      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.task._task.willmatchwith.html b/docs/api/v2.0.0/en/folktale.concurrency.task._task.willmatchwith.html index c6f9df3..e2d4922 100644 --- a/docs/api/v2.0.0/en/folktale.concurrency.task._task.willmatchwith.html +++ b/docs/api/v2.0.0/en/folktale.concurrency.task._task.willmatchwith.html @@ -8,7 +8,7 @@

      willMatchWith

      Chooses and executes a function for each variant in a Task. The function must return a new task, whose value and state will be assimilated.

      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.task.fromnodeback.html b/docs/api/v2.0.0/en/folktale.concurrency.task.fromnodeback.html index 29e28c6..2adbcc1 100644 --- a/docs/api/v2.0.0/en/folktale.concurrency.task.fromnodeback.html +++ b/docs/api/v2.0.0/en/folktale.concurrency.task.fromnodeback.html @@ -8,7 +8,7 @@

      fromNodeback

      A convenience method for the folktale/conversions/nodeback-to-task module.

      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.

      Signature

      fromNodeback(aNodeback)
      forall s, e:
      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.task.frompromised.html b/docs/api/v2.0.0/en/folktale.concurrency.task.frompromised.html
      index 82d0822..c8a4f16 100644
      --- a/docs/api/v2.0.0/en/folktale.concurrency.task.frompromised.html
      +++ b/docs/api/v2.0.0/en/folktale.concurrency.task.frompromised.html
      @@ -8,7 +8,7 @@
         
         
           
           

      fromPromised

      Converts a Promise-yielding function to a Task-yielding function.

      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.

      Signature

      fromPromised(aPromiseFn)
      forall e, v:
      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.task.html b/docs/api/v2.0.0/en/folktale.concurrency.task.html
      index 8677b38..1d2d359 100644
      --- a/docs/api/v2.0.0/en/folktale.concurrency.task.html
      +++ b/docs/api/v2.0.0/en/folktale.concurrency.task.html
      @@ -8,7 +8,7 @@
         
         
           
           

      module folktale/concurrency/task

      A data structure that models asynchronous actions, supporting safe cancellation and automatic resource handling.

      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

      A data structure that models asynchronous actions, supporting safe cancellation and automatic resource handling.

      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.task.task.task.html b/docs/api/v2.0.0/en/folktale.concurrency.task.task.task.html index e8e10b6..fc59ca2 100644 --- a/docs/api/v2.0.0/en/folktale.concurrency.task.task.task.html +++ b/docs/api/v2.0.0/en/folktale.concurrency.task.task.task.html @@ -8,7 +8,7 @@

      task

      Constructs a Task and associates a computation to it. The computation is executed every time the Task is ran, and should provide the result of the task: a success or failure along with its value.

      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.

      Signature

      task(computation)
      forall value, reason:
      diff --git a/docs/api/v2.0.0/en/folktale.concurrency.task.wait-all.waitall.html b/docs/api/v2.0.0/en/folktale.concurrency.task.wait-all.waitall.html
      index bb85deb..8bc55c1 100644
      --- a/docs/api/v2.0.0/en/folktale.concurrency.task.wait-all.waitall.html
      +++ b/docs/api/v2.0.0/en/folktale.concurrency.task.wait-all.waitall.html
      @@ -8,7 +8,7 @@
         
         
           
           

      waitAll

      Constructs a new task that waits all given tasks resolve. The result of the new task is an array with the results of the input tasks, if they all succeed, or diff --git a/docs/api/v2.0.0/en/folktale.concurrency.task.wait-any.waitany.html b/docs/api/v2.0.0/en/folktale.concurrency.task.wait-any.waitany.html index 9e299d3..566da3d 100644 --- a/docs/api/v2.0.0/en/folktale.concurrency.task.wait-any.waitany.html +++ b/docs/api/v2.0.0/en/folktale.concurrency.task.wait-any.waitany.html @@ -8,7 +8,7 @@

      waitAny

      Constructs a new task that waits any of the given tasks resolve. The result of the first task to resolve is assimilated by the new task.

      diff --git a/docs/api/v2.0.0/en/folktale.conversions.future-to-promise.futuretopromise.html b/docs/api/v2.0.0/en/folktale.conversions.future-to-promise.futuretopromise.html index fd834ed..a61a492 100644 --- a/docs/api/v2.0.0/en/folktale.conversions.future-to-promise.futuretopromise.html +++ b/docs/api/v2.0.0/en/folktale.conversions.future-to-promise.futuretopromise.html @@ -8,7 +8,7 @@

      futureToPromise

      Converts a Future into a Promise.

      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.

      Signature

      futureToPromise(aFuture)
      forall e, v:
      diff --git a/docs/api/v2.0.0/en/folktale.conversions.html b/docs/api/v2.0.0/en/folktale.conversions.html
      index bb85140..987fbfb 100644
      --- a/docs/api/v2.0.0/en/folktale.conversions.html
      +++ b/docs/api/v2.0.0/en/folktale.conversions.html
      @@ -8,7 +8,7 @@
         
         
           
           

      module folktale/conversions

      Allows converting between the different data structures provided by Folktale and JavaScript.

      Documentation

      Allows converting between the different data structures provided by Folktale and JavaScript.

      diff --git a/docs/api/v2.0.0/en/folktale.conversions.maybe-to-result.maybetoresult.html b/docs/api/v2.0.0/en/folktale.conversions.maybe-to-result.maybetoresult.html index 8e36803..398473a 100644 --- a/docs/api/v2.0.0/en/folktale.conversions.maybe-to-result.maybetoresult.html +++ b/docs/api/v2.0.0/en/folktale.conversions.maybe-to-result.maybetoresult.html @@ -8,7 +8,7 @@

      maybeToResult

      Converts a Maybe to an Result. Nothings map to Errors, Justs map to Oks.

      diff --git a/docs/api/v2.0.0/en/folktale.conversions.maybe-to-validation.maybetovalidation.html b/docs/api/v2.0.0/en/folktale.conversions.maybe-to-validation.maybetovalidation.html index 279cae8..2f8ce77 100644 --- a/docs/api/v2.0.0/en/folktale.conversions.maybe-to-validation.maybetovalidation.html +++ b/docs/api/v2.0.0/en/folktale.conversions.maybe-to-validation.maybetovalidation.html @@ -8,7 +8,7 @@

      maybeToValidation

      Converts a Maybe to a Validation. Nothings map to Failures, Justs map to Successes.

      diff --git a/docs/api/v2.0.0/en/folktale.conversions.nodeback-to-task.nodebacktotask.html b/docs/api/v2.0.0/en/folktale.conversions.nodeback-to-task.nodebacktotask.html index 03f4aaa..16a2ca4 100644 --- a/docs/api/v2.0.0/en/folktale.conversions.nodeback-to-task.nodebacktotask.html +++ b/docs/api/v2.0.0/en/folktale.conversions.nodeback-to-task.nodebacktotask.html @@ -8,7 +8,7 @@

      nodebackToTask

      Converts a function with a Node-style callback to a Task.

      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.

      Signature

      nodebackToTask(fn)
      forall s, e, r:
      diff --git a/docs/api/v2.0.0/en/folktale.conversions.nullable-to-maybe.nullabletomaybe.html b/docs/api/v2.0.0/en/folktale.conversions.nullable-to-maybe.nullabletomaybe.html
      index 396a69a..be1b6f2 100644
      --- a/docs/api/v2.0.0/en/folktale.conversions.nullable-to-maybe.nullabletomaybe.html
      +++ b/docs/api/v2.0.0/en/folktale.conversions.nullable-to-maybe.nullabletomaybe.html
      @@ -8,7 +8,7 @@
         
         
           
           

      nullableToMaybe

      Converts a nullable value to a maybe. null and undefined map to Nothing, any other value maps to Justs.

      diff --git a/docs/api/v2.0.0/en/folktale.conversions.nullable-to-result.nullabletoresult.html b/docs/api/v2.0.0/en/folktale.conversions.nullable-to-result.nullabletoresult.html index 4aef9f0..6eef582 100644 --- a/docs/api/v2.0.0/en/folktale.conversions.nullable-to-result.nullabletoresult.html +++ b/docs/api/v2.0.0/en/folktale.conversions.nullable-to-result.nullabletoresult.html @@ -8,7 +8,7 @@

      nullableToResult

      Converts a nullable value to a Result. null and undefined map to Errors, any other value maps to Oks.

      diff --git a/docs/api/v2.0.0/en/folktale.conversions.nullable-to-validation.nullabletovalidation.html b/docs/api/v2.0.0/en/folktale.conversions.nullable-to-validation.nullabletovalidation.html index 30c1de5..71908ca 100644 --- a/docs/api/v2.0.0/en/folktale.conversions.nullable-to-validation.nullabletovalidation.html +++ b/docs/api/v2.0.0/en/folktale.conversions.nullable-to-validation.nullabletovalidation.html @@ -8,7 +8,7 @@

      nullableToValidation

      Converts a nullable value to a Validation. null and undefined map to Failures, any other type maps to Successes.

      diff --git a/docs/api/v2.0.0/en/folktale.conversions.promise-to-future.promisetofuture.html b/docs/api/v2.0.0/en/folktale.conversions.promise-to-future.promisetofuture.html index b5d1c6c..2ab065d 100644 --- a/docs/api/v2.0.0/en/folktale.conversions.promise-to-future.promisetofuture.html +++ b/docs/api/v2.0.0/en/folktale.conversions.promise-to-future.promisetofuture.html @@ -8,7 +8,7 @@

      promiseToFuture

      Converts a Promise to a folktale Future.

      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.

      Signature

      promiseToFuture(aPromise)
      forall e, v:
      diff --git a/docs/api/v2.0.0/en/folktale.conversions.promised-to-task.promisedtotask.html b/docs/api/v2.0.0/en/folktale.conversions.promised-to-task.promisedtotask.html
      index 44493d9..6b53b82 100644
      --- a/docs/api/v2.0.0/en/folktale.conversions.promised-to-task.promisedtotask.html
      +++ b/docs/api/v2.0.0/en/folktale.conversions.promised-to-task.promisedtotask.html
      @@ -8,7 +8,7 @@
         
         
           
           

      promisedToTask

      Converts a Promise-yielding function to a Task-yielding function.

      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.

      Signature

      promisedToTask(aPromiseFn)
      forall e, v, r:
      diff --git a/docs/api/v2.0.0/en/folktale.conversions.result-to-maybe.resulttomaybe.html b/docs/api/v2.0.0/en/folktale.conversions.result-to-maybe.resulttomaybe.html
      index bcf16a9..f07ccd7 100644
      --- a/docs/api/v2.0.0/en/folktale.conversions.result-to-maybe.resulttomaybe.html
      +++ b/docs/api/v2.0.0/en/folktale.conversions.result-to-maybe.resulttomaybe.html
      @@ -8,7 +8,7 @@
         
         
           
           

      resultToMaybe

      Converts an Result structure to a Maybe structure. Errors map to Nothings, Oks map to Justs.

      diff --git a/docs/api/v2.0.0/en/folktale.conversions.result-to-validation.resulttovalidation.html b/docs/api/v2.0.0/en/folktale.conversions.result-to-validation.resulttovalidation.html index c811525..608ee9f 100644 --- a/docs/api/v2.0.0/en/folktale.conversions.result-to-validation.resulttovalidation.html +++ b/docs/api/v2.0.0/en/folktale.conversions.result-to-validation.resulttovalidation.html @@ -8,7 +8,7 @@

      resultToValidation

      Converts an Result to a Validation. Errors map to Failures, Oks map to Successes.

      diff --git a/docs/api/v2.0.0/en/folktale.conversions.validation-to-maybe.validationtomaybe.html b/docs/api/v2.0.0/en/folktale.conversions.validation-to-maybe.validationtomaybe.html index 3214e30..3338bf8 100644 --- a/docs/api/v2.0.0/en/folktale.conversions.validation-to-maybe.validationtomaybe.html +++ b/docs/api/v2.0.0/en/folktale.conversions.validation-to-maybe.validationtomaybe.html @@ -8,7 +8,7 @@

      validationToMaybe

      Converts a Validation to a Maybe. Failures map to Nothings, Successes map to Justs.

      diff --git a/docs/api/v2.0.0/en/folktale.conversions.validation-to-result.validationtoresult.html b/docs/api/v2.0.0/en/folktale.conversions.validation-to-result.validationtoresult.html index e05f7c5..d2e217a 100644 --- a/docs/api/v2.0.0/en/folktale.conversions.validation-to-result.validationtoresult.html +++ b/docs/api/v2.0.0/en/folktale.conversions.validation-to-result.validationtoresult.html @@ -8,7 +8,7 @@

      validationToResult

      Converts a Validation to an Result. Failures map to Errors, Successes map to Oks.

      diff --git a/docs/api/v2.0.0/en/folktale.core.html b/docs/api/v2.0.0/en/folktale.core.html index bbbbffe..ea2005c 100644 --- a/docs/api/v2.0.0/en/folktale.core.html +++ b/docs/api/v2.0.0/en/folktale.core.html @@ -8,7 +8,7 @@

      module folktale/core

      Utilities for handling native JavaScript objects in a more functional way. Lambda adds functions to combine functions and simplify abstractions (such as currying and partial application). Object provides functions to handle JS objects as functional dictionaries.

      Documentation

      Utilities for handling native JavaScript objects in a more functional way. Lambda adds functions to combine functions and simplify abstractions (such as currying and partial application). Object provides functions to handle JS objects as functional dictionaries.

      diff --git a/docs/api/v2.0.0/en/folktale.core.lambda.compose.all.html b/docs/api/v2.0.0/en/folktale.core.lambda.compose.all.html index bd91a00..d1ab2fb 100644 --- a/docs/api/v2.0.0/en/folktale.core.lambda.compose.all.html +++ b/docs/api/v2.0.0/en/folktale.core.lambda.compose.all.html @@ -8,7 +8,7 @@

      all

      Conveniently composes multiple functions.

      Signature

      all(...fns)
      (Function...) -> Function

      Documentation

      Conveniently composes multiple functions.

      diff --git a/docs/api/v2.0.0/en/folktale.core.lambda.compose.compose.html b/docs/api/v2.0.0/en/folktale.core.lambda.compose.compose.html index ac449cd..74ef187 100644 --- a/docs/api/v2.0.0/en/folktale.core.lambda.compose.compose.html +++ b/docs/api/v2.0.0/en/folktale.core.lambda.compose.compose.html @@ -8,7 +8,7 @@

      compose

      Composes two functions.

      Signature

      compose(f, g)(value)
      (('b) => 'c, ('a) => 'b) => (('a) => 'c)

      Documentation

      Composes two functions.

      diff --git a/docs/api/v2.0.0/en/folktale.core.lambda.compose.infix.html b/docs/api/v2.0.0/en/folktale.core.lambda.compose.infix.html index 725f18d..a08462d 100644 --- a/docs/api/v2.0.0/en/folktale.core.lambda.compose.infix.html +++ b/docs/api/v2.0.0/en/folktale.core.lambda.compose.infix.html @@ -8,7 +8,7 @@

      infix

      Conveniently composes function with the This-Binding syntax.

      Signature

      infix(that)
      (('b) => 'c) . (('a) => 'b) => (('a) => 'c)

      Documentation

      Conveniently composes function with the This-Binding syntax.

      diff --git a/docs/api/v2.0.0/en/folktale.core.lambda.constant.constant.html b/docs/api/v2.0.0/en/folktale.core.lambda.constant.constant.html index bb3eb5d..a44f72d 100644 --- a/docs/api/v2.0.0/en/folktale.core.lambda.constant.constant.html +++ b/docs/api/v2.0.0/en/folktale.core.lambda.constant.constant.html @@ -8,7 +8,7 @@

      constant

      The constant combinator; always returns the first argument given.

      Signature

      constant(value)
      ('a) => ('b) => 'a

      Documentation

      The constant combinator; always returns the first argument given.

      diff --git a/docs/api/v2.0.0/en/folktale.core.lambda.curry.curry.html b/docs/api/v2.0.0/en/folktale.core.lambda.curry.curry.html index 104c2b4..c913034 100644 --- a/docs/api/v2.0.0/en/folktale.core.lambda.curry.curry.html +++ b/docs/api/v2.0.0/en/folktale.core.lambda.curry.curry.html @@ -8,7 +8,7 @@

      curry

      Transforms functions of arity N into a chain of N unary functions

      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.

      Signature

      curry(arity, fn)
      (Number, (Any...) => 'a) => Any... => 'a or ((Any...) => 'a)

      Documentation

      Transforms functions of arity N into a chain of N unary functions

      diff --git a/docs/api/v2.0.0/en/folktale.core.lambda.html b/docs/api/v2.0.0/en/folktale.core.lambda.html index 1d00f23..5c8e1df 100644 --- a/docs/api/v2.0.0/en/folktale.core.lambda.html +++ b/docs/api/v2.0.0/en/folktale.core.lambda.html @@ -8,7 +8,7 @@

      module folktale/core/lambda

      Core.Lambda provides you tools for transforming and combining functions.

      diff --git a/docs/api/v2.0.0/en/folktale.core.lambda.identity.identity.html b/docs/api/v2.0.0/en/folktale.core.lambda.identity.identity.html index c3c0153..15b65e3 100644 --- a/docs/api/v2.0.0/en/folktale.core.lambda.identity.identity.html +++ b/docs/api/v2.0.0/en/folktale.core.lambda.identity.identity.html @@ -8,7 +8,7 @@

      identity

      The identity combinator; always returns the argument given.

      Signature

      identity(value)
      ('a) => 'a

      Documentation

      The identity combinator; always returns the argument given.

      diff --git a/docs/api/v2.0.0/en/folktale.core.lambda.partialize.hole.html b/docs/api/v2.0.0/en/folktale.core.lambda.partialize.hole.html index 739a303..f88ba85 100644 --- a/docs/api/v2.0.0/en/folktale.core.lambda.partialize.hole.html +++ b/docs/api/v2.0.0/en/folktale.core.lambda.partialize.hole.html @@ -8,7 +8,7 @@

      hole

      Represents a place in an argument list that needs to be filled.

      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

      Represents a place in an argument list that needs to be filled.

      diff --git a/docs/api/v2.0.0/en/folktale.core.lambda.partialize.partialize.html b/docs/api/v2.0.0/en/folktale.core.lambda.partialize.partialize.html index 42bd80b..027d582 100644 --- a/docs/api/v2.0.0/en/folktale.core.lambda.partialize.partialize.html +++ b/docs/api/v2.0.0/en/folktale.core.lambda.partialize.partialize.html @@ -8,7 +8,7 @@

      partialize

      Creates a new function where some of the arguments are specified.

      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.

      Signature

      partialize(arity, fn)
      (Number, (Any... => Any)) => ((hole | Any)...) => Any :: (throw TypeError)

      Documentation

      Creates a new function where some of the arguments are specified.

      diff --git a/docs/api/v2.0.0/en/folktale.core.object.from-pairs.frompairs.html b/docs/api/v2.0.0/en/folktale.core.object.from-pairs.frompairs.html index 321d73e..f94e142 100644 --- a/docs/api/v2.0.0/en/folktale.core.object.from-pairs.frompairs.html +++ b/docs/api/v2.0.0/en/folktale.core.object.from-pairs.frompairs.html @@ -8,7 +8,7 @@

      fromPairs

      Constructs an object from an array of (key, value) pairs.

      Signature

      fromPairs(pairs)
      (Array (String or Symbol, 'a)) => Object 'a

      Documentation

      Constructs an object from an array of (key, value) pairs.

      diff --git a/docs/api/v2.0.0/en/folktale.core.object.html b/docs/api/v2.0.0/en/folktale.core.object.html index ce1aee7..060634a 100644 --- a/docs/api/v2.0.0/en/folktale.core.object.html +++ b/docs/api/v2.0.0/en/folktale.core.object.html @@ -8,7 +8,7 @@

      module folktale/core/object

      Core.Object provides utilities for working with objects as dictionaries and records.

      diff --git a/docs/api/v2.0.0/en/folktale.core.object.map-entries.mapentries.html b/docs/api/v2.0.0/en/folktale.core.object.map-entries.mapentries.html index 52d802e..0bd1bd8 100644 --- a/docs/api/v2.0.0/en/folktale.core.object.map-entries.mapentries.html +++ b/docs/api/v2.0.0/en/folktale.core.object.map-entries.mapentries.html @@ -8,7 +8,7 @@

      mapEntries

      Transforms own properties of an object using a mapping function.

      Signature

      mapEntries(object, transform, define)
      (
      diff --git a/docs/api/v2.0.0/en/folktale.core.object.map-entries.overwrite.html b/docs/api/v2.0.0/en/folktale.core.object.map-entries.overwrite.html
      index 64a8951..0fa9678 100644
      --- a/docs/api/v2.0.0/en/folktale.core.object.map-entries.overwrite.html
      +++ b/docs/api/v2.0.0/en/folktale.core.object.map-entries.overwrite.html
      @@ -8,7 +8,7 @@
         
         
           
           

      overwrite

      Transforms own properties of an object using a mapping function.

      Signature

      overwrite(object, transform)
      (Object 'a, ((String, 'a)) => (String, 'b)) => Object 'b

      Documentation

      Transforms own properties of an object using a mapping function.

      diff --git a/docs/api/v2.0.0/en/folktale.core.object.map-entries.unique.html b/docs/api/v2.0.0/en/folktale.core.object.map-entries.unique.html index 4a70121..6b046f6 100644 --- a/docs/api/v2.0.0/en/folktale.core.object.map-entries.unique.html +++ b/docs/api/v2.0.0/en/folktale.core.object.map-entries.unique.html @@ -8,7 +8,7 @@

      unique

      Transforms own properties of an object using a mapping function.

      Signature

      unique(object, transform)
      (Object 'a, ((String, 'a)) => (String, 'b)) => Object 'b :: throws Error

      Documentation

      Transforms own properties of an object using a mapping function.

      diff --git a/docs/api/v2.0.0/en/folktale.core.object.map-values.infix.html b/docs/api/v2.0.0/en/folktale.core.object.map-values.infix.html index bc08d96..bc593b1 100644 --- a/docs/api/v2.0.0/en/folktale.core.object.map-values.infix.html +++ b/docs/api/v2.0.0/en/folktale.core.object.map-values.infix.html @@ -8,7 +8,7 @@

      infix

      Conveniently transforms values in an object using the This-Binding syntax.

      Signature

      infix(transformation)
      (Object 'a) . (('a) => 'b) => Object 'b

      Documentation

      Conveniently transforms values in an object using the This-Binding syntax.

      diff --git a/docs/api/v2.0.0/en/folktale.core.object.map-values.mapvalues.html b/docs/api/v2.0.0/en/folktale.core.object.map-values.mapvalues.html index c8fab0c..3ac6219 100644 --- a/docs/api/v2.0.0/en/folktale.core.object.map-values.mapvalues.html +++ b/docs/api/v2.0.0/en/folktale.core.object.map-values.mapvalues.html @@ -8,7 +8,7 @@

      mapValues

      Transforms values of an object with an unary function.

      Signature

      mapValues(object, transformation)
      (Object 'a, ('a) => 'b) => Object 'b

      Documentation

      Transforms values of an object with an unary function.

      diff --git a/docs/api/v2.0.0/en/folktale.core.object.to-pairs.topairs.html b/docs/api/v2.0.0/en/folktale.core.object.to-pairs.topairs.html index 30b3b5f..6fcd5a1 100644 --- a/docs/api/v2.0.0/en/folktale.core.object.to-pairs.topairs.html +++ b/docs/api/v2.0.0/en/folktale.core.object.to-pairs.topairs.html @@ -8,7 +8,7 @@

      toPairs

      Returns pairs of (key, value) for all own enumerable properties in an object.

      Signature

      toPairs(object)
      (Object 'a) => Array (String or Symbol, 'a)

      Documentation

      Returns pairs of (key, value) for all own enumerable properties in an object.

      diff --git a/docs/api/v2.0.0/en/folktale.core.object.values.values.html b/docs/api/v2.0.0/en/folktale.core.object.values.values.html index 3660a62..46dc3c8 100644 --- a/docs/api/v2.0.0/en/folktale.core.object.values.values.html +++ b/docs/api/v2.0.0/en/folktale.core.object.values.values.html @@ -8,7 +8,7 @@

      values

      Returns the values for all own enumerable properties in an object.

      Signature

      values(object)
      (Object 'a) => Array 'a

      Documentation

      Returns the values for all own enumerable properties in an object.

      diff --git a/docs/api/v2.0.0/en/folktale.fantasy-land.apply.apply.html b/docs/api/v2.0.0/en/folktale.fantasy-land.apply.apply.html index 9018437..b19cc00 100644 --- a/docs/api/v2.0.0/en/folktale.fantasy-land.apply.apply.html +++ b/docs/api/v2.0.0/en/folktale.fantasy-land.apply.apply.html @@ -8,7 +8,7 @@

      apply

      Applies the function inside an applicative to the value of another applicative.

      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.

      Signature

      apply(applicativeFunction, applicativeValue)
      forall F, a, b:
      diff --git a/docs/api/v2.0.0/en/folktale.fantasy-land.apply.curried.html b/docs/api/v2.0.0/en/folktale.fantasy-land.apply.curried.html
      index ce0d1b1..d127e0c 100644
      --- a/docs/api/v2.0.0/en/folktale.fantasy-land.apply.curried.html
      +++ b/docs/api/v2.0.0/en/folktale.fantasy-land.apply.curried.html
      @@ -8,7 +8,7 @@
         
         
           
           

      curried

      Applies the function inside an applicative to the value of another applicative.

      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.

      Signature

      forall F, a, b:
      diff --git a/docs/api/v2.0.0/en/folktale.fantasy-land.apply.infix.html b/docs/api/v2.0.0/en/folktale.fantasy-land.apply.infix.html
      index 4173156..b4eeb7a 100644
      --- a/docs/api/v2.0.0/en/folktale.fantasy-land.apply.infix.html
      +++ b/docs/api/v2.0.0/en/folktale.fantasy-land.apply.infix.html
      @@ -8,7 +8,7 @@
         
         
           
           

      infix

      Applies the function inside an applicative to the value of another applicative.

      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.

      Signature

      infix(applicativeValue)
      forall F, a, b:
      diff --git a/docs/api/v2.0.0/en/folktale.fantasy-land.bimap.bimap.html b/docs/api/v2.0.0/en/folktale.fantasy-land.bimap.bimap.html
      index 4d7df97..f2d5459 100644
      --- a/docs/api/v2.0.0/en/folktale.fantasy-land.bimap.bimap.html
      +++ b/docs/api/v2.0.0/en/folktale.fantasy-land.bimap.bimap.html
      @@ -8,7 +8,7 @@
         
         
           
           

      bimap

      Maps one function over each side of a Bifunctor.

      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.

      Signature

      bimap(bifunctor, transformLeft, transformRight)
      forall F, a, b, c, d:
      diff --git a/docs/api/v2.0.0/en/folktale.fantasy-land.bimap.curried.html b/docs/api/v2.0.0/en/folktale.fantasy-land.bimap.curried.html
      index 5095aab..696760d 100644
      --- a/docs/api/v2.0.0/en/folktale.fantasy-land.bimap.curried.html
      +++ b/docs/api/v2.0.0/en/folktale.fantasy-land.bimap.curried.html
      @@ -8,7 +8,7 @@
         
         
           
           

      curried

      Maps one function over each side of a Bifunctor.

      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.

      Signature

      forall F, a, b, c, d:
      diff --git a/docs/api/v2.0.0/en/folktale.fantasy-land.bimap.infix.html b/docs/api/v2.0.0/en/folktale.fantasy-land.bimap.infix.html
      index a31c2f3..919f0d5 100644
      --- a/docs/api/v2.0.0/en/folktale.fantasy-land.bimap.infix.html
      +++ b/docs/api/v2.0.0/en/folktale.fantasy-land.bimap.infix.html
      @@ -8,7 +8,7 @@
         
         
           
           

      infix

      Maps one function over each side of a Bifunctor.

      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.

      Signature

      infix(transformLeft, transformRight)
      forall F, a, b, c, d:
      diff --git a/docs/api/v2.0.0/en/folktale.fantasy-land.chain.chain-1.html b/docs/api/v2.0.0/en/folktale.fantasy-land.chain.chain-1.html
      new file mode 100644
      index 0000000..214a4a1
      --- /dev/null
      +++ b/docs/api/v2.0.0/en/folktale.fantasy-land.chain.chain-1.html
      @@ -0,0 +1,30 @@
      +
      +
      +
      +  
      +    infix
      +    
      +    
      +  
      +  
      +    
      +    

      infix

      Transforms a monad with an unary function.

      +
      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.

      Signature

      infix(transformation)
      forall C, a, b:
      +  (C a).((a) => C b) => C b
      +where C is Chain

      Documentation

      Transforms a monad with an unary function.

      +

      Properties

      Source Code

      function(transformation) {
      +  return chain(this, transformation);
      +}
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/fantasy-land/chain
      On This Page
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.fantasy-land.chain.chain-2.html b/docs/api/v2.0.0/en/folktale.fantasy-land.chain.chain-2.html new file mode 100644 index 0000000..668fd85 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.fantasy-land.chain.chain-2.html @@ -0,0 +1,33 @@ + + + + + chain + + + + + +

      chain

      Transforms a monad with an unary function.

      +
      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.

      Signature

      chain(monad, transformation)
      forall C, a, b:
      +  (C a, (a) => C b) => C b
      +where C is Chain

      Documentation

      Transforms a monad with an unary function.

      +

      Properties

      Convenience

      curried()

      Transforms a monad with an unary function.

      +
      Experimental
      infix(transformation)

      Transforms a monad with an unary function.

      +
      Experimental

      Source Code

      Defined in source/fantasy-land/chain.js at line 30, column 0
      (monad, transformation) =>
      +  isNew(monad) ?  monad[flChain](transformation)
      +: isOld(monad) ?  warn(monad.chain(transformation))
      +: /*otherwise*/   unsupported(monad)
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/fantasy-land/chain
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • @boris-marinov
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.fantasy-land.chain.chain.html b/docs/api/v2.0.0/en/folktale.fantasy-land.chain.chain.html index 69b156e..3ad6fec 100644 --- a/docs/api/v2.0.0/en/folktale.fantasy-land.chain.chain.html +++ b/docs/api/v2.0.0/en/folktale.fantasy-land.chain.chain.html @@ -2,24 +2,21 @@ - chain + curried -

      chain

      Transforms a monad with an unary function.

      -
      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.

      Signature

      chain(monad, transformation)
      forall C, a, b:
      -  (C a, (a) => C b) => C b
      +    

      curried

      Transforms a monad with an unary function.

      +
      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.

      Signature

      forall C, a, b:
      +  ((a) => C b) => (C a) => C b
       where C is Chain

      Documentation

      Transforms a monad with an unary function.

      -

      Properties

      Convenience

      curried()

      Transforms a monad with an unary function.

      -
      Experimental
      infix(transformation)

      Transforms a monad with an unary function.

      -
      Experimental

      Source Code

      Defined in source/fantasy-land/chain.js at line 30, column 0
      (monad, transformation) =>
      -  isNew(monad) ?  monad[flChain](transformation)
      -: isOld(monad) ?  warn(monad.chain(transformation))
      -: /*otherwise*/   unsupported(monad)
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/fantasy-land/chain
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • @boris-marinov
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      +

      Properties

      Source Code

      curry(2, (transformation, monad) =>   // eslint-disable-line no-magic-numbers
      +  chain(monad, transformation)
      +)
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/fantasy-land/chain
      On This Page
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • @boris-marinov
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.fantasy-land.concat.concat-2.html b/docs/api/v2.0.0/en/folktale.fantasy-land.concat.concat-2.html new file mode 100644 index 0000000..d2d2393 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.fantasy-land.concat.concat-2.html @@ -0,0 +1,33 @@ + + + + + concat + + + + + +

      concat

      Joins two semigroups.

      +
      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.

      Signature

      concat(semigroupLeft, semigroupRight)
      forall S, a:
      +  (S a, S a) => S a
      +where S is Semigroup

      Documentation

      Joins two semigroups.

      +

      Properties

      Convenience

      curried()

      Joins two semigroups.

      +
      Experimental
      infix(aSemigroup)

      Joins two semigroups.

      +
      Experimental

      Source Code

      Defined in source/fantasy-land/concat.js at line 30, column 0
      (semigroupLeft, semigroupRight) =>
      +  isNewSemigroup(semigroupLeft) ?  semigroupLeft[flConcat](semigroupRight)
      +: isOldSemigroup(semigroupLeft) ?  warn(semigroupLeft.concat(semigroupRight))
      +: /*otherwise*/                    unsupported(semigroupLeft)
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/fantasy-land/concat
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • @boris-marinov
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.fantasy-land.concat.concat.html b/docs/api/v2.0.0/en/folktale.fantasy-land.concat.concat.html index 57cbac0..8c9d775 100644 --- a/docs/api/v2.0.0/en/folktale.fantasy-land.concat.concat.html +++ b/docs/api/v2.0.0/en/folktale.fantasy-land.concat.concat.html @@ -2,24 +2,21 @@ - concat + curried -

      concat

      Joins two semigroups.

      -
      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.

      Signature

      concat(semigroupLeft, semigroupRight)
      forall S, a:
      -  (S a, S a) => S a
      +    

      curried

      Joins two semigroups.

      +
      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.

      Signature

      forall S, a:
      +  (S a) => (S a) => S a
       where S is Semigroup

      Documentation

      Joins two semigroups.

      -

      Properties

      Convenience

      curried()

      Joins two semigroups.

      -
      Experimental
      infix(aSemigroup)

      Joins two semigroups.

      -
      Experimental

      Source Code

      Defined in source/fantasy-land/concat.js at line 30, column 0
      (semigroupLeft, semigroupRight) =>
      -  isNewSemigroup(semigroupLeft) ?  semigroupLeft[flConcat](semigroupRight)
      -: isOldSemigroup(semigroupLeft) ?  warn(semigroupLeft.concat(semigroupRight))
      -: /*otherwise*/                    unsupported(semigroupLeft)
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/fantasy-land/concat
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • @boris-marinov
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      +

      Properties

      Source Code

      curry(2, (semigroupRight, semigroupLeft) =>    // eslint-disable-line no-magic-numbers
      +  concat(semigroupLeft, semigroupRight)
      +)
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/fantasy-land/concat
      On This Page
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • @boris-marinov
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.fantasy-land.empty.empty-2.html b/docs/api/v2.0.0/en/folktale.fantasy-land.empty.empty-2.html new file mode 100644 index 0000000..1a847a9 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.fantasy-land.empty.empty-2.html @@ -0,0 +1,35 @@ + + + + + empty + + + + + +

      empty

      Returns the identity object for a monoid.

      +
      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.

      Signature

      empty(monoid)
      forall M, a:
      +  (M) => M a
      +where M is Monoid

      Documentation

      Returns the identity object for a monoid.

      +

      Properties

      Convenience

      curried()

      Returns the identity object for a monoid.

      +
      Experimental
      infix()

      Returns the identity object for a monoid.

      +
      Experimental

      Source Code

      Defined in source/fantasy-land/empty.js at line 33, column 0
      (monoid) =>
      +  isNew(monoid)     ?  monoid[flEmpty]()
      +: isCtorNew(monoid) ?  monoid.constructor[flEmpty]()
      +: isOld(monoid)     ?  warn(monoid.empty())
      +: isCtorOld(monoid) ?  warn(monoid.constructor.empty())
      +: /*otherwise*/        unsupported(monoid)
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/fantasy-land/empty
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • @boris-marinov
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.fantasy-land.empty.empty.html b/docs/api/v2.0.0/en/folktale.fantasy-land.empty.empty.html index 4f134eb..d9c10ea 100644 --- a/docs/api/v2.0.0/en/folktale.fantasy-land.empty.empty.html +++ b/docs/api/v2.0.0/en/folktale.fantasy-land.empty.empty.html @@ -2,26 +2,19 @@ - empty + curried -

      empty

      Returns the identity object for a monoid.

      -
      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.

      Signature

      empty(monoid)
      forall M, a:
      +    

      curried

      Returns the identity object for a monoid.

      +
      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.

      Signature

      forall M, a:
         (M) => M a
       where M is Monoid

      Documentation

      Returns the identity object for a monoid.

      -

      Properties

      Convenience

      curried()

      Returns the identity object for a monoid.

      -
      Experimental
      infix()

      Returns the identity object for a monoid.

      -
      Experimental

      Source Code

      Defined in source/fantasy-land/empty.js at line 33, column 0
      (monoid) =>
      -  isNew(monoid)     ?  monoid[flEmpty]()
      -: isCtorNew(monoid) ?  monoid.constructor[flEmpty]()
      -: isOld(monoid)     ?  warn(monoid.empty())
      -: isCtorOld(monoid) ?  warn(monoid.constructor.empty())
      -: /*otherwise*/        unsupported(monoid)
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/fantasy-land/empty
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • @boris-marinov
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      +

      Properties

      Source Code

      curry(1, empty)
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/fantasy-land/empty
      On This Page
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • @boris-marinov
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.fantasy-land.equals.equals-2.html b/docs/api/v2.0.0/en/folktale.fantasy-land.equals.equals-2.html new file mode 100644 index 0000000..2292c06 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.fantasy-land.equals.equals-2.html @@ -0,0 +1,33 @@ + + + + + equals + + + + + +

      equals

      Compares two setoids for equality.

      +
      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.

      Signature

      equals(setoidLeft, setoidRight)
      forall S, a:
      +  (S a, S a) => Boolean
      +where S is Setoid

      Documentation

      Compares two setoids for equality.

      +

      Properties

      Convenience

      curried()

      Compares two setoids for equality.

      +
      Experimental
      infix(aSetoid)

      Compares two setoids for equality.

      +
      Experimental

      Source Code

      Defined in source/fantasy-land/equals.js at line 31, column 0
      (setoidLeft, setoidRight) =>
      +  isNew(setoidLeft) ?  setoidLeft[flEquals](setoidRight)
      +: isOld(setoidLeft) ?  warn(setoidLeft.equals(setoidRight))
      +: /*otherwise*/        unsupported(setoidLeft)
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/fantasy-land/equals
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • @boris-marinov
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.fantasy-land.equals.equals.html b/docs/api/v2.0.0/en/folktale.fantasy-land.equals.equals.html index 78e41ae..528837f 100644 --- a/docs/api/v2.0.0/en/folktale.fantasy-land.equals.equals.html +++ b/docs/api/v2.0.0/en/folktale.fantasy-land.equals.equals.html @@ -2,24 +2,21 @@ - equals + curried -

      equals

      Compares two setoids for equality.

      -
      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.

      Signature

      equals(setoidLeft, setoidRight)
      forall S, a:
      -  (S a, S a) => Boolean
      +    

      curried

      Compares two setoids for equality.

      +
      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.

      Signature

      forall S, a:
      +  (S a) => (S a) => Boolean
       where S is Setoid

      Documentation

      Compares two setoids for equality.

      -

      Properties

      Convenience

      curried()

      Compares two setoids for equality.

      -
      Experimental
      infix(aSetoid)

      Compares two setoids for equality.

      -
      Experimental

      Source Code

      Defined in source/fantasy-land/equals.js at line 31, column 0
      (setoidLeft, setoidRight) =>
      -  isNew(setoidLeft) ?  setoidLeft[flEquals](setoidRight)
      -: isOld(setoidLeft) ?  warn(setoidLeft.equals(setoidRight))
      -: /*otherwise*/        unsupported(setoidLeft)
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/fantasy-land/equals
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • @boris-marinov
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      +

      Properties

      Source Code

      curry(2, (setoidRight, setoidLeft) =>    // eslint-disable-line no-magic-numbers
      +  equals(setoidLeft, setoidRight)
      +)
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/fantasy-land/equals
      On This Page
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • @boris-marinov
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.fantasy-land.map.map-2.html b/docs/api/v2.0.0/en/folktale.fantasy-land.map.map-2.html new file mode 100644 index 0000000..648e607 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.fantasy-land.map.map-2.html @@ -0,0 +1,33 @@ + + + + + map + + + + + +

      map

      Transforms the contents of a Functor.

      +
      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.

      Signature

      map(functor, transformation)
      forall F, a, b:
      +  (F a, (a) => b) => F b
      +where F is Functor

      Documentation

      Transforms the contents of a Functor.

      +

      Properties

      Convenience

      curried()

      Transforms the contents of a Functor.

      +
      Experimental
      infix(transformation)

      Transforms the contents of a Functor.

      +
      Experimental

      Source Code

      Defined in source/fantasy-land/map.js at line 30, column 0
      (functor, transformation) =>
      +  isNew(functor) ?  functor[flMap](transformation)
      +: isOld(functor) ?  warn(functor.map(transformation))
      +: /*otherwise*/     unsupported(functor)
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/fantasy-land/map
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • @boris-marinov
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.fantasy-land.map.map.html b/docs/api/v2.0.0/en/folktale.fantasy-land.map.map.html index 4fa6681..22aff67 100644 --- a/docs/api/v2.0.0/en/folktale.fantasy-land.map.map.html +++ b/docs/api/v2.0.0/en/folktale.fantasy-land.map.map.html @@ -2,24 +2,21 @@ - map + curried -

      map

      Transforms the contents of a Functor.

      -
      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.

      Signature

      map(functor, transformation)
      forall F, a, b:
      -  (F a, (a) => b) => F b
      +    

      curried

      Transforms the contents of a Functor.

      +
      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.

      Signature

      forall F, a, b:
      +  ((a) => b) => (F a) => F b
       where F is Functor

      Documentation

      Transforms the contents of a Functor.

      -

      Properties

      Convenience

      curried()

      Transforms the contents of a Functor.

      -
      Experimental
      infix(transformation)

      Transforms the contents of a Functor.

      -
      Experimental

      Source Code

      Defined in source/fantasy-land/map.js at line 30, column 0
      (functor, transformation) =>
      -  isNew(functor) ?  functor[flMap](transformation)
      -: isOld(functor) ?  warn(functor.map(transformation))
      -: /*otherwise*/     unsupported(functor)
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/fantasy-land/map
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • @boris-marinov
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      +

      Properties

      Source Code

      curry(2, (transformation, functor) =>     // eslint-disable-line no-magic-numbers
      +  map(functor, transformation)
      +)
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/fantasy-land/map
      On This Page
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • @boris-marinov
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.maybe.maybe.apply.html b/docs/api/v2.0.0/en/folktale.maybe.maybe.apply.html index 8cc7b4e..084ede2 100644 --- a/docs/api/v2.0.0/en/folktale.maybe.maybe.apply.html +++ b/docs/api/v2.0.0/en/folktale.maybe.maybe.apply.html @@ -8,7 +8,7 @@

      apply

      Transforms a Maybe value using a function contained in another Maybe. As with .map(), the Maybe values are expected to be Just, and no operation is diff --git a/docs/api/v2.0.0/en/folktale.maybe.maybe.cata-1.html b/docs/api/v2.0.0/en/folktale.maybe.maybe.cata-1.html new file mode 100644 index 0000000..ed2d1e6 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.maybe.maybe.cata-1.html @@ -0,0 +1,65 @@ + + + + + cata + + + + +

      +

      cata

      This method has been replaced by matchWith(pattern). cata(morphism) selects +and executes a function for each variant of the Maybe structure.

      +
      Deprecated since 2.0.0

      The cata(morphism) terminology is not very welcoming for people +who are not familiar with some obscure jargon in functional programming. +In addition to that, due to the design of Folktale's 2 union constructor, +it's not possible to provide the same interface as Folktale 1's .cata() +method, so changing the name while deprecating the old functionality +allows people to move to Folktale 2 without breaking their code.

      +

      Signature

      forall a, b:
      +  (Maybe a).({
      +    Nothing: () => b,
      +    Just: (a) => b
      +  }) => b

      Documentation

      This method has been replaced by matchWith(pattern). cata(morphism) selects +and executes a function for each variant of the Maybe structure.

      +

      Example:

      +
      const Maybe = require('folktale/maybe');
      +
      +Maybe.Just(1).cata({
      +  Nothing: ()   => 'nothing',
      +  Just: (value) => `got ${value}`
      +});
      +// ==> 'got 1'
      +
      +Maybe.Nothing().cata({
      +  Nothing: ()   => 'nothing',
      +  Just: (value) => `got ${value}`
      +});
      +// ==> 'nothing'
      +

      Properties

      Source Code

      Defined in source/maybe/maybe.js at line 57, column 18
      {
      +    /*~*/
      +    Nothing: function cata(pattern) {
      +      warnDeprecation('`.cata(pattern)` is deprecated. Use `.matchWith(pattern)` instead.');
      +      return pattern.Nothing();
      +    },
      +
      +    /*~*/
      +    Just: function cata(pattern) {
      +      warnDeprecation('`.cata(pattern)` is deprecated. Use `.matchWith(pattern)` instead.');
      +      return pattern.Just(this.value);
      +    }
      +  }
      Stability
      deprecated
      Licence
      MIT
      Module
      folktale/maybe/maybe
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.maybe.maybe.cata.html b/docs/api/v2.0.0/en/folktale.maybe.maybe.cata.html index 91102b7..ed2d1e6 100644 --- a/docs/api/v2.0.0/en/folktale.maybe.maybe.cata.html +++ b/docs/api/v2.0.0/en/folktale.maybe.maybe.cata.html @@ -8,7 +8,7 @@

      cata

      This method has been replaced by matchWith(pattern). cata(morphism) selects and executes a function for each variant of the Maybe structure.

      diff --git a/docs/api/v2.0.0/en/folktale.maybe.maybe.chain-1.html b/docs/api/v2.0.0/en/folktale.maybe.maybe.chain-1.html new file mode 100644 index 0000000..b40e081 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.maybe.maybe.chain-1.html @@ -0,0 +1,64 @@ + + + + + chain + + + + + +

      chain

      Transforms an entire Maybe structure with the provided function. As with +.map(), the transformation is only applied if the value is a Just, but +unlike .map() the transformation is expected to return a new Maybe value.

      +

      Signature

      forall a, b: (Maybe a).((a) => Maybe b) => Maybe b

      Documentation

      Transforms an entire Maybe structure with the provided function. As with +.map(), the transformation is only applied if the value is a Just, but +unlike .map() the transformation is expected to return a new Maybe value.

      +

      Having the transformation function return a new Maybe value means that the +transformation may fail, and the failure is appropriately propagated. In this +sense, a.chain(f) works similarly to the sequencing of statements done by the +; syntax in JavaScript — the next instruction only runs if the previous +instruction succeeds, and either instructions may fail.

      +

      Example:

      +
      const Maybe = require('folktale/maybe');
      +
      +function first(list) {
      +  return list.length > 0 ?  Maybe.Just(list[0])
      +  :      /* otherwise */    Maybe.Nothing();
      +}
      +
      +first([]).chain(first);
      +// ==> Maybe.Nothing()
      +
      +first([[1]]).chain(first);
      +// ==> Maybe.Just(1)
      +
      +first([[]]).chain(first);
      +// ==> Maybe.Nothing()
      +

      Properties

      Source Code

      Defined in source/maybe/maybe.js at line 57, column 18
      {
      +    /*~*/
      +    Nothing: function chain(transformation) {
      +      assertFunction('Maybe.Nothing#chain', transformation);
      +      return this;
      +    },
      +
      +    /*~*/
      +    Just: function chain(transformation) {
      +      assertFunction('Maybe.Just#chain', transformation);
      +      return transformation(this.value);
      +    }
      +  }
      Stability
      stable
      Licence
      MIT
      Module
      folktale/maybe/maybe
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.maybe.maybe.chain.html b/docs/api/v2.0.0/en/folktale.maybe.maybe.chain.html index 4b72f39..b40e081 100644 --- a/docs/api/v2.0.0/en/folktale.maybe.maybe.chain.html +++ b/docs/api/v2.0.0/en/folktale.maybe.maybe.chain.html @@ -8,7 +8,7 @@

      chain

      Transforms an entire Maybe structure with the provided function. As with .map(), the transformation is only applied if the value is a Just, but diff --git a/docs/api/v2.0.0/en/folktale.maybe.maybe.concat-1.html b/docs/api/v2.0.0/en/folktale.maybe.maybe.concat-1.html new file mode 100644 index 0000000..0e551a8 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.maybe.maybe.concat-1.html @@ -0,0 +1,40 @@ + + + + + concat + + + + +

      +

      concat

      Signature

      forall a: (Maybe a).(Maybe a) => Maybe a
      +where a is Semigroup

      Documentation

      Properties

      Source Code

      Defined in source/maybe/maybe.js at line 57, column 18
      {
      +    /*~*/
      +    Nothing: function concat(aMaybe) {
      +      assertMaybe('Maybe.Nothing#concat', aMaybe);
      +      return aMaybe;
      +    },
      +
      +    /*~*/
      +    Just: function concat(aMaybe) {
      +      assertMaybe('Maybe.Just#concat', aMaybe);
      +      return aMaybe.matchWith({
      +        Nothing: () => Just(this.value),
      +        Just: (a) => Just(this.value.concat(a.value))
      +      });
      +    }
      +  }
      Licence
      MIT
      Module
      folktale/maybe/maybe
      On This Page
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • @diasbruno
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.maybe.maybe.concat.html b/docs/api/v2.0.0/en/folktale.maybe.maybe.concat.html index 24ce56c..0e551a8 100644 --- a/docs/api/v2.0.0/en/folktale.maybe.maybe.concat.html +++ b/docs/api/v2.0.0/en/folktale.maybe.maybe.concat.html @@ -8,7 +8,7 @@

      concat

      Signature

      forall a: (Maybe a).(Maybe a) => Maybe a
       where a is Semigroup

      Documentation

      Properties

      Source Code

      Defined in source/maybe/maybe.js at line 57, column 18
      {
      diff --git a/docs/api/v2.0.0/en/folktale.maybe.maybe.empty.html b/docs/api/v2.0.0/en/folktale.maybe.maybe.empty.html
      index 1cc5aa5..7e2c442 100644
      --- a/docs/api/v2.0.0/en/folktale.maybe.maybe.empty.html
      +++ b/docs/api/v2.0.0/en/folktale.maybe.maybe.empty.html
      @@ -8,7 +8,7 @@
         
         
           
           

      empty

      Signature

      empty()
      forall a: () => Maybe a

      Documentation

      Properties

      Source Code

      Defined in source/maybe/maybe.js at line 249, column 21
      empty() {
           return Nothing();
      diff --git a/docs/api/v2.0.0/en/folktale.maybe.maybe.fold-1.html b/docs/api/v2.0.0/en/folktale.maybe.maybe.fold-1.html
      new file mode 100644
      index 0000000..d4c9c82
      --- /dev/null
      +++ b/docs/api/v2.0.0/en/folktale.maybe.maybe.fold-1.html
      @@ -0,0 +1,55 @@
      +
      +
      +
      +  
      +    fold
      +    
      +    
      +  
      +  
      +    
      +    

      fold

      Applies a function to each variant of the Maybe structure.

      +

      Signature

      forall a, b: (Maybe a).(() => b, (a) => b) => b

      Documentation

      Applies a function to each variant of the Maybe structure.

      +

      Example:

      +
      const Maybe = require('folktale/maybe');
      +
      +Maybe.Just(1).fold(
      +  (()  => 'nothing'),
      +  ((v) => `got ${v}`)
      +);
      +// ==> 'got 1'
      +
      +Maybe.Nothing().fold(
      +  (()  => 'nothing'),
      +  ((v) => `got ${v}`)
      +);
      +// ==> 'nothing'
      +

      Properties

      Source Code

      Defined in source/maybe/maybe.js at line 57, column 18
      {
      +    /*~*/
      +    Nothing: function(transformNothing, transformJust) {
      +      assertFunction('Maybe.Nothing#fold', transformNothing);
      +      assertFunction('Maybe.Nothing#fold', transformJust);
      +      return transformNothing();
      +    },
      +
      +    /*~*/
      +    Just: function(transformNothing, transformJust) {
      +      assertFunction('Maybe.Just#fold', transformNothing);
      +      assertFunction('Maybe.Just#fold', transformJust);
      +      return transformJust(this.value);
      +    }
      +  }
      Licence
      MIT
      Module
      folktale/maybe/maybe
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.maybe.maybe.fold.html b/docs/api/v2.0.0/en/folktale.maybe.maybe.fold.html index 66df9e7..d4c9c82 100644 --- a/docs/api/v2.0.0/en/folktale.maybe.maybe.fold.html +++ b/docs/api/v2.0.0/en/folktale.maybe.maybe.fold.html @@ -8,7 +8,7 @@

      fold

      Applies a function to each variant of the Maybe structure.

      Signature

      forall a, b: (Maybe a).(() => b, (a) => b) => b

      Documentation

      Applies a function to each variant of the Maybe structure.

      diff --git a/docs/api/v2.0.0/en/folktale.maybe.maybe.get.html b/docs/api/v2.0.0/en/folktale.maybe.maybe.get.html index 5b1d4f7..3b7fc65 100644 --- a/docs/api/v2.0.0/en/folktale.maybe.maybe.get.html +++ b/docs/api/v2.0.0/en/folktale.maybe.maybe.get.html @@ -8,7 +8,7 @@

      get

      This method has been renamed to unsafeGet().

      Deprecated since 2.0.0

      We want to discourage the use of partial functions, and having short names diff --git a/docs/api/v2.0.0/en/folktale.maybe.maybe.getorelse-1.html b/docs/api/v2.0.0/en/folktale.maybe.maybe.getorelse-1.html new file mode 100644 index 0000000..6f027db --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.maybe.maybe.getorelse-1.html @@ -0,0 +1,44 @@ + + + + + getOrElse + + + + +

      +

      getOrElse

      Extracts the value of a Maybe structure, if it exists (i.e.: is a Just), +otherwise returns the provided default value.

      +

      Signature

      forall a: (Maybe a).(a) => a

      Documentation

      Extracts the value of a Maybe structure, if it exists (i.e.: is a Just), +otherwise returns the provided default value.

      +

      Example:

      +
      const Maybe = require('folktale/maybe');
      +
      +Maybe.Just(1).getOrElse(2);   // ==> 1
      +Maybe.Nothing().getOrElse(2); // ==> 2
      +

      Properties

      Source Code

      Defined in source/maybe/maybe.js at line 57, column 18
      {
      +    /*~*/
      +    Nothing: function getOrElse(_default) {
      +      return _default;
      +    },
      +
      +    /*~*/
      +    Just: function getOrElse(_default) {
      +      return this.value;
      +    }
      +  }
      Licence
      MIT
      Module
      folktale/maybe/maybe
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.maybe.maybe.getorelse.html b/docs/api/v2.0.0/en/folktale.maybe.maybe.getorelse.html index 3bb069a..6f027db 100644 --- a/docs/api/v2.0.0/en/folktale.maybe.maybe.getorelse.html +++ b/docs/api/v2.0.0/en/folktale.maybe.maybe.getorelse.html @@ -8,7 +8,7 @@

      getOrElse

      Extracts the value of a Maybe structure, if it exists (i.e.: is a Just), otherwise returns the provided default value.

      diff --git a/docs/api/v2.0.0/en/folktale.maybe.maybe.inspect-1.html b/docs/api/v2.0.0/en/folktale.maybe.maybe.inspect-1.html new file mode 100644 index 0000000..9ee26a4 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.maybe.maybe.inspect-1.html @@ -0,0 +1,26 @@ + + + + + toString + + + + + +

      toString

      A textual representation of the Nothing variant.

      +
      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.

      Signature

      toString()
      () => String

      Documentation

      A textual representation of the Nothing variant.

      +

      Properties

      Source Code

      () => variantName
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/maybe/maybe
      On This Page
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • @boris-marinov
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.maybe.maybe.inspect.html b/docs/api/v2.0.0/en/folktale.maybe.maybe.inspect.html index 5fc014d..fb03905 100644 --- a/docs/api/v2.0.0/en/folktale.maybe.maybe.inspect.html +++ b/docs/api/v2.0.0/en/folktale.maybe.maybe.inspect.html @@ -8,10 +8,10 @@ -

      toString

      A textual representation of the Nothing variant.

      -
      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.

      Signature

      toString()
      () => String

      Documentation

      A textual representation of the Nothing variant.

      +

      toString

      A textual representation of the Just variant.

      +
      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.

      Signature

      toString()
      () => String

      Documentation

      A textual representation of the Just variant.

      Properties

      Source Code

      () => variantName
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/maybe/maybe
      On This Page
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • @boris-marinov
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.maybe.maybe.map.html b/docs/api/v2.0.0/en/folktale.maybe.maybe.map.html index 2184f6c..68ec407 100644 --- a/docs/api/v2.0.0/en/folktale.maybe.maybe.map.html +++ b/docs/api/v2.0.0/en/folktale.maybe.maybe.map.html @@ -8,7 +8,7 @@

      map

      Transforms the value inside a Maybe structure with an unary function. Only transforms values that are successful (Just), and constructs a new Maybe as a diff --git a/docs/api/v2.0.0/en/folktale.maybe.maybe.of.html b/docs/api/v2.0.0/en/folktale.maybe.maybe.of.html index 397d18d..e3e7514 100644 --- a/docs/api/v2.0.0/en/folktale.maybe.maybe.of.html +++ b/docs/api/v2.0.0/en/folktale.maybe.maybe.of.html @@ -8,7 +8,7 @@

      of

      Constructs a Maybe value that represents a successful value (a Just).

      Signature

      of(value)
      forall a: (a) => Maybe a

      Documentation

      Constructs a Maybe value that represents a successful value (a Just).

      diff --git a/docs/api/v2.0.0/en/folktale.maybe.maybe.orelse-1.html b/docs/api/v2.0.0/en/folktale.maybe.maybe.orelse-1.html new file mode 100644 index 0000000..9005e25 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.maybe.maybe.orelse-1.html @@ -0,0 +1,66 @@ + + + + + orElse + + + + + +

      orElse

      Allows recovering from from failed Maybe values.

      +

      Signature

      forall a: (Maybe a).((a) => Maybe a) => Maybe a

      Documentation

      Allows recovering from from failed Maybe values.

      +

      While .chain() allows one to sequence operations, such that the second +operation is ran only if the first one succeeds, and their state is propagated, +.orElse() allows one to recover from a failed operation by providing a new +state.

      +

      Example:

      +
      const Maybe = require('folktale/maybe');
      +
      +function first(list) {
      +  return list.length > 0 ?   Maybe.Just(list[0])
      +  :      /* otherwise */     Maybe.Nothing();
      +}
      +
      +let failures = 0;
      +function emitFailure() {
      +  failures += 1;
      +  return Maybe.Just('failed');
      +}
      +
      +first(['one']).orElse(emitFailure);
      +// ==> Maybe.Just('one')
      +
      +failures; // ==> 0
      +
      +first([]).orElse(emitFailure);
      +// ==> Maybe.Just('failed')
      +
      +failures; // ==> 1
      +

      Properties

      Source Code

      Defined in source/maybe/maybe.js at line 57, column 18
      {
      +    /*~*/
      +    Nothing: function orElse(handler) {
      +      assertFunction('Maybe.Nothing#orElse', handler);
      +      return handler(this.value);
      +    },
      +
      +    /*~*/
      +    Just: function orElse(handler) {
      +      assertFunction('Maybe.Nothing#orElse', handler);
      +      return this;
      +    }
      +  }
      Licence
      MIT
      Module
      folktale/maybe/maybe
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.maybe.maybe.orelse.html b/docs/api/v2.0.0/en/folktale.maybe.maybe.orelse.html index 39d0e0b..9005e25 100644 --- a/docs/api/v2.0.0/en/folktale.maybe.maybe.orelse.html +++ b/docs/api/v2.0.0/en/folktale.maybe.maybe.orelse.html @@ -8,7 +8,7 @@

      orElse

      Allows recovering from from failed Maybe values.

      Signature

      forall a: (Maybe a).((a) => Maybe a) => Maybe a

      Documentation

      Allows recovering from from failed Maybe values.

      diff --git a/docs/api/v2.0.0/en/folktale.maybe.maybe.toresult.html b/docs/api/v2.0.0/en/folktale.maybe.maybe.toresult.html index caff06e..484a2fe 100644 --- a/docs/api/v2.0.0/en/folktale.maybe.maybe.toresult.html +++ b/docs/api/v2.0.0/en/folktale.maybe.maybe.toresult.html @@ -8,7 +8,7 @@

      toResult

      A convenience method for the folktale/conversions/maybe-to-result module.

      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.

      Signature

      toResult(fallbackValue)
      forall a, b: (Maybe a).(b) => Result b a

      Documentation

      A convenience method for the folktale/conversions/maybe-to-result module.

      diff --git a/docs/api/v2.0.0/en/folktale.maybe.maybe.tovalidation.html b/docs/api/v2.0.0/en/folktale.maybe.maybe.tovalidation.html index 3eeda8f..3c7a8d5 100644 --- a/docs/api/v2.0.0/en/folktale.maybe.maybe.tovalidation.html +++ b/docs/api/v2.0.0/en/folktale.maybe.maybe.tovalidation.html @@ -8,7 +8,7 @@

      toValidation

      A convenience method for the folktale/conversions/maybe-to-validation module.

      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.

      Signature

      toValidation(fallbackValue)
      forall a, b: (Maybe a).(b) => Result b a

      Documentation

      A convenience method for the folktale/conversions/maybe-to-validation module.

      diff --git a/docs/api/v2.0.0/en/folktale.maybe.maybe.unsafeget-1.html b/docs/api/v2.0.0/en/folktale.maybe.maybe.unsafeget-1.html new file mode 100644 index 0000000..fba373e --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.maybe.maybe.unsafeget-1.html @@ -0,0 +1,58 @@ + + + + + unsafeGet + + + + + +

      unsafeGet

      Extracts the value from a Just structure.

      +

      Signature

      forall a: (Maybe a).() => a :: (throws TypeError)

      Documentation

      Extracts the value from a Just structure.

      +
      +

      WARNING
      This method is partial, which means that it will only work for +Just structures, not for Nothing structures. It's recommended +to use .getOrElse() or .matchWith() instead.

      +
      +

      Example:

      +
      const Maybe = require('folktale/maybe');
      +
      +Maybe.Just(1).unsafeGet(); // ==> 1
      +
      +try {
      +  Maybe.Nothing().unsafeGet();
      +  // TypeError: Can't extract the value of a Nothing
      +} catch (e) {
      +  e instanceof TypeError; // ==> true
      +}
      +

      Properties

      Source Code

      Defined in source/maybe/maybe.js at line 57, column 18
      {
      +    /*~*/
      +    Nothing: function unsafeGet() {
      +      throw new TypeError(`Can't extract the value of a Nothing.
      +
      +    Since Nothing holds no values, it's not possible to extract one from them.
      +    You might consider switching from Maybe#get to Maybe#getOrElse, or some other method
      +    that is not partial.
      +      `);
      +    },
      +
      +    /*~*/
      +    Just: function unsafeGet() {
      +      return this.value;
      +    }
      +  }
      Licence
      MIT
      Module
      folktale/maybe/maybe
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.maybe.maybe.unsafeget.html b/docs/api/v2.0.0/en/folktale.maybe.maybe.unsafeget.html index ca1ed5e..fba373e 100644 --- a/docs/api/v2.0.0/en/folktale.maybe.maybe.unsafeget.html +++ b/docs/api/v2.0.0/en/folktale.maybe.maybe.unsafeget.html @@ -8,7 +8,7 @@

      unsafeGet

      Extracts the value from a Just structure.

      Signature

      forall a: (Maybe a).() => a :: (throws TypeError)

      Documentation

      Extracts the value from a Just structure.

      diff --git a/docs/api/v2.0.0/en/folktale.maybe.maybe.value.html b/docs/api/v2.0.0/en/folktale.maybe.maybe.value.html index 7535ccd..41a77ef 100644 --- a/docs/api/v2.0.0/en/folktale.maybe.maybe.value.html +++ b/docs/api/v2.0.0/en/folktale.maybe.maybe.value.html @@ -8,7 +8,7 @@

      value

      The value contained in a Just instance of the Maybe structure.

      Signature

      get value()
      forall a: get (Maybe a) => a

      Documentation

      The value contained in a Just instance of the Maybe structure.

      diff --git a/docs/api/v2.0.0/en/folktale.result.frommaybe.html b/docs/api/v2.0.0/en/folktale.result.frommaybe.html index 1f50c58..3fa8e97 100644 --- a/docs/api/v2.0.0/en/folktale.result.frommaybe.html +++ b/docs/api/v2.0.0/en/folktale.result.frommaybe.html @@ -8,7 +8,7 @@

      fromMaybe

      A convenience method for the folktale/conversions/maybe-to-result module.

      Signature

      fromMaybe(aMaybe, failureValue)
      forall a, b: (Maybe b, a) => Result a b

      Documentation

      A convenience method for the folktale/conversions/maybe-to-result module.

      diff --git a/docs/api/v2.0.0/en/folktale.result.fromnullable.html b/docs/api/v2.0.0/en/folktale.result.fromnullable.html index 8037803..475ea61 100644 --- a/docs/api/v2.0.0/en/folktale.result.fromnullable.html +++ b/docs/api/v2.0.0/en/folktale.result.fromnullable.html @@ -8,7 +8,7 @@

      fromNullable

      A convenience method for the folktale/conversions/nullable-to-result module.

      diff --git a/docs/api/v2.0.0/en/folktale.result.fromvalidation.html b/docs/api/v2.0.0/en/folktale.result.fromvalidation.html index 59c8165..9f74909 100644 --- a/docs/api/v2.0.0/en/folktale.result.fromvalidation.html +++ b/docs/api/v2.0.0/en/folktale.result.fromvalidation.html @@ -8,7 +8,7 @@

      fromValidation

      A convenience method for the folktale/conversions/validation-to-result module.

      diff --git a/docs/api/v2.0.0/en/folktale.result.html b/docs/api/v2.0.0/en/folktale.result.html index 790cdb4..03f9bbb 100644 --- a/docs/api/v2.0.0/en/folktale.result.html +++ b/docs/api/v2.0.0/en/folktale.result.html @@ -8,7 +8,7 @@

      module folktale/result

      A data structure that models the result of operations that may fail. A Result helps with representing errors and propagating them, giving users a more diff --git a/docs/api/v2.0.0/en/folktale.result.result.1.html b/docs/api/v2.0.0/en/folktale.result.result.1.html index c04f8c8..1805ff6 100644 --- a/docs/api/v2.0.0/en/folktale.result.result.1.html +++ b/docs/api/v2.0.0/en/folktale.result.result.1.html @@ -8,16 +8,16 @@

      Ok

      Constructs a Result whose value represents a success.

      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.

      Signature

      Ok(value)
      forall a, b: (b) => Result a b

      Documentation

      Constructs a Result whose value represents a success.

      See the documentation for the Result structure to understand how to use this.

      Static properties

      Comparing and testing

      hasInstance(value)

      Tests if an arbitrary value is a Ok case of a Result instance.

      -
      Experimental

      Debugging

      inspect: toString()

      A textual representation of the Ok variant.

      -
      Experimental
      toString()

      A textual representation of the Ok variant.

      +
      Experimental

      Debugging

      inspect: toString()

      A textual representation of the Ok variant.

      +
      Experimental
      toString()

      A textual representation of the Ok variant.

      Experimental

      Special values

      get constructor

      The constructor for this variant.

      -
      Experimental
      prototype

      The container for instance methods for Ok variants of the Result structure.

      +
      Experimental
      prototype

      The container for instance methods for Ok variants of the Result structure.

      Experimental
      get tag

      The tag for this variant, unique among the Result variants.

      Experimental
      get type

      The type for this variant, unique among Folktale data structures (and ideally unique among all unions in your application, as its used for type checking).

      Experimental

      Instance (prototype) properties

      Comparing and testing

      equals(value)

      Performs a deep-comparison of two Result values for equality. See adt/union/derivations/equality for details.

      @@ -26,14 +26,14 @@
      Deprecated

      Constructing

      of(value)

      Constructs a Result holding an Ok value.

      ExperimentalInherited

      Converting to other types

      toMaybe()

      Transforms a Result into a Maybe. Error values are lost in the process.

      ExperimentalInherited
      toValidation()

      Transforms a Result into a Validation.

      -
      ExperimentalInherited

      Data fields

      get value

      The value contained in an Ok instance of the Result structure.

      +
      ExperimentalInherited

      Data fields

      get value

      The value contained in an Ok instance of the Result structure.

      Abstract

      Debugging

      inspect: toString()

      A textual representation for Result instances.

      Experimental
      toString()

      A textual representation for Result instances.

      Experimental

      Extracting values

      get()

      This method has been renamed to unsafeGet().

      -
      DeprecatedInherited
      getOrElse()

      Extracts the value of a Result structure, if it exists (i.e.: is an Ok), +

      DeprecatedInherited
      getOrElse()

      Extracts the value of a Result structure, if it exists (i.e.: is an Ok), otherwise returns the provided default value.

      Experimental
      merge()

      Returns the value inside of the Result structure, regardless of its state.

      -
      ExperimentalInherited
      unsafeGet()

      Extracts the value from a Result structure.

      +
      ExperimentalInherited
      unsafeGet()

      Extracts the value from a Result structure.

      Experimental

      Fantasy Land

      ap(that)

      Part of the Applicative instance for Fantasy Land 1.x. See the apply method for details.

      fantasy-land/ap(that)

      Part of the Applicative instance for Fantasy Land 2.x+. See the apply method for details.

      fantasy-land/bimap(f, g)

      Part of the Bifunctor instance for Fantasy Land 2.x+. See the bimap method for details.

      @@ -43,17 +43,17 @@
      fantasy-land/map(transformation)

      Part of the Functor instance for Fantasy Land 2.x+. See the map method for details.

      fantasy-land/of(value)

      Part of the Applicative instance for Fantasy Land 2.x+. See the of method for details.

      Meta-programming

      derive(...derivations)

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

      -
      ExperimentalInherited

      Pattern matching

      fold()

      Applies a function to each case of a Result.

      +
      ExperimentalInherited

      Pattern matching

      fold()

      Applies a function to each case of a Result.

      Experimental
      matchWith(pattern)

      Chooses and executes a function for each variant in the Result structure.

      -
      Experimental

      Recovering from errors

      orElse()

      Allows recovering from Error values with a handler function.

      -
      Experimental
      swap()

      Inverts the context of a Result value such that Errors are transformed into Oks, +

      Experimental

      Recovering from errors

      orElse()

      Allows recovering from Error values with a handler function.

      +
      Experimental
      swap()

      Inverts the context of a Result value such that Errors are transformed into Oks, and Oks are transformed into Errors. Does not touch the value inside of the Result.

      Experimental

      Serialising

      fromJSON(value, parsers = { [typeName]: adt }, keysIndicateType = false)

      Parses a JavaScript object previously serialised as aResult.toJSON() into a proper Result structure.

      ExperimentalInherited
      toJSON()

      Converts a Result value to a JavaScript object that may be stored as a JSON value.

      -
      Experimental

      Special values

      get constructor

      The constructor for this variant.

      +
      Experimental

      Special values

      get constructor

      The constructor for this variant.

      variants

      The variants in the Result structure.

      ExperimentalInherited

      Transforming

      apply()

      Applies the function contained in one Result to the value in another Result. Application only occurs if both Results are Ok, otherwise keeps the first diff --git a/docs/api/v2.0.0/en/folktale.result.result.apply-1.html b/docs/api/v2.0.0/en/folktale.result.result.apply-1.html new file mode 100644 index 0000000..ac9b0e0 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.result.result.apply-1.html @@ -0,0 +1,64 @@ + + + + + apply + + + + +

      +

      apply

      Applies the function contained in one Result to the value in another Result. +Application only occurs if both Results are Ok, otherwise keeps the first +Error.

      +
      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.

      Signature

      forall a, b, c:
      +  (Result a ((b) => c)).(Result a b) => Result a c

      Documentation

      Applies the function contained in one Result to the value in another Result. +Application only occurs if both Results are Ok, otherwise keeps the first +Error.

      +

      Note that Result.Ok(x => x + 1).apply(Result.Ok(1)) is equivalent to +Result.Ok(1).map(x => x + 1).

      +

      Example:

      +
      const Result = require('folktale/result');
      +
      +function increment(value) {
      +  return value + 1;
      +}
      +
      +Result.Ok(increment).apply(Result.Ok(1));
      +// ==> Result.Ok(2)
      +
      +Result.Ok(increment).apply(Result.Error(1));
      +// ==> Result.Error(1)
      +
      +Result.Error(increment).apply(Result.Ok(1));
      +// ==> Result.Error(increment)
      +
      +Result.Error(increment).apply(Result.Error(1));
      +// ==> Result.Error(increment)
      +

      Properties

      Source Code

      Defined in source/result/result.js at line 75, column 19
      {
      +    /*~*/
      +    Error: function apply(anResult) {
      +      assertResult('Result.Error#apply', anResult);
      +      return this;
      +    },
      +
      +    /*~*/
      +    Ok: function apply(anResult) {
      +      assertResult('Result.Ok#apply', anResult);
      +      return anResult.map(this.value);
      +    }
      +  }
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/result/result
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.result.result.apply.html b/docs/api/v2.0.0/en/folktale.result.result.apply.html index d9765cc..ac9b0e0 100644 --- a/docs/api/v2.0.0/en/folktale.result.result.apply.html +++ b/docs/api/v2.0.0/en/folktale.result.result.apply.html @@ -8,7 +8,7 @@

      apply

      Applies the function contained in one Result to the value in another Result. Application only occurs if both Results are Ok, otherwise keeps the first diff --git a/docs/api/v2.0.0/en/folktale.result.result.bimap-1.html b/docs/api/v2.0.0/en/folktale.result.result.bimap-1.html new file mode 100644 index 0000000..7455962 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.result.result.bimap-1.html @@ -0,0 +1,57 @@ + + + + + bimap + + + + +

      +

      bimap

      Transforms each side of a Result with a function, without changing the context +of the computation. That is, Errors will still be Errors, Oks will still be +Oks.

      +
      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.

      Signature

      (Result a b).((a) => c, (b) => d) => Result c d

      Documentation

      Transforms each side of a Result with a function, without changing the context +of the computation. That is, Errors will still be Errors, Oks will still be +Oks.

      +

      Example:

      +
      const Result = require('folktale/result');
      +
      +const inc = (x) => x + 1;
      +const dec = (x) => x - 1;
      +
      +
      +Result.Ok(1).bimap(inc, dec);
      +// ==> Result.Ok(dec(1))
      +
      +Result.Error(1).bimap(inc, dec);
      +// ==> Result.Error(inc(1))
      +

      Properties

      Source Code

      Defined in source/result/result.js at line 75, column 19
      {
      +    /*~*/
      +    Error: function bimap(f, g) {
      +      assertFunction('Result.Error#bimap', f);
      +      assertFunction('Result.Error#bimap', g);
      +      return Error(f(this.value));
      +    },
      +
      +    /*~*/
      +    Ok: function bimap(f, g) {
      +      assertFunction('Result.Ok#bimap', f);
      +      assertFunction('Result.Ok#bimap', g);
      +      return Ok(g(this.value));
      +    }
      +  }
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/result/result
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.result.result.bimap.html b/docs/api/v2.0.0/en/folktale.result.result.bimap.html index a3fadec..7455962 100644 --- a/docs/api/v2.0.0/en/folktale.result.result.bimap.html +++ b/docs/api/v2.0.0/en/folktale.result.result.bimap.html @@ -8,7 +8,7 @@

      bimap

      Transforms each side of a Result with a function, without changing the context of the computation. That is, Errors will still be Errors, Oks will still be diff --git a/docs/api/v2.0.0/en/folktale.result.result.chain-1.html b/docs/api/v2.0.0/en/folktale.result.result.chain-1.html new file mode 100644 index 0000000..f07730c --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.result.result.chain-1.html @@ -0,0 +1,62 @@ + + + + + chain + + + + +

      +

      chain

      Transforms the value and context of a Result computation with an unary function. +As with .map(), the transformation is only applied if the value is an Ok, +but the transformation is expected a new Result value, which then becomes the +result of the method.

      +
      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.

      Signature

      forall a, b, c:
      +  (Result a b).((b) => Result a c) => Result a c

      Documentation

      Transforms the value and context of a Result computation with an unary function. +As with .map(), the transformation is only applied if the value is an Ok, +but the transformation is expected a new Result value, which then becomes the +result of the method.

      +

      Example:

      +
      const Result = require('folktale/result');
      +
      +const divideBy = (a) => (b) =>
      +  a === 0        ?  Result.Error('division by zero')
      +: /* otherwise */   Result.Ok(b / a);
      +
      +
      +Result.Ok(4).chain(divideBy(2));
      +// ==> Result.Ok(2)
      +
      +Result.Error(4).chain(divideBy(2));
      +// ==> Result.Error(4)
      +
      +Result.Ok(4).chain(divideBy(0));
      +// ==> Result.Error('division by zero')
      +

      Properties

      Source Code

      Defined in source/result/result.js at line 75, column 19
      {
      +    /*~*/
      +    Error: function chain(f) {
      +      assertFunction('Result.Error#chain', f);
      +      return this;
      +    },
      +
      +    /*~*/
      +    Ok: function chain(f) {
      +      assertFunction('Result.Ok#chain', f);
      +      return f(this.value);
      +    }
      +  }
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/result/result
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.result.result.chain.html b/docs/api/v2.0.0/en/folktale.result.result.chain.html index 6eca36d..f07730c 100644 --- a/docs/api/v2.0.0/en/folktale.result.result.chain.html +++ b/docs/api/v2.0.0/en/folktale.result.result.chain.html @@ -8,7 +8,7 @@

      chain

      Transforms the value and context of a Result computation with an unary function. As with .map(), the transformation is only applied if the value is an Ok, diff --git a/docs/api/v2.0.0/en/folktale.result.result.concat-1.html b/docs/api/v2.0.0/en/folktale.result.result.concat-1.html new file mode 100644 index 0000000..eb7229d --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.result.result.concat-1.html @@ -0,0 +1,37 @@ + + + + + concat + + + + +

      +

      concat

      Signature

      forall a, b: (Result a b).(Result a b) => Result a b
      +where b is Semigroup

      Documentation

      Properties

      Source Code

      Defined in source/result/result.js at line 75, column 19
      {
      +    /*~*/
      +    Error: function concat(aResult) {
      +      assertResult('Result.Error#concat', aResult);
      +      return this;
      +    },
      +
      +    /*~*/
      +    Ok: function concat(aResult) {
      +      assertResult('Result.Ok#concat', aResult);
      +      return aResult.map(xs => this.value.concat(xs));
      +    }
      +  }
      Stability
      stable
      Licence
      MIT
      Module
      folktale/result/result
      On This Page
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.result.result.concat.html b/docs/api/v2.0.0/en/folktale.result.result.concat.html index 84fc4b8..eb7229d 100644 --- a/docs/api/v2.0.0/en/folktale.result.result.concat.html +++ b/docs/api/v2.0.0/en/folktale.result.result.concat.html @@ -8,7 +8,7 @@

      concat

      Signature

      forall a, b: (Result a b).(Result a b) => Result a b
       where b is Semigroup

      Documentation

      Properties

      Source Code

      Defined in source/result/result.js at line 75, column 19
      {
      diff --git a/docs/api/v2.0.0/en/folktale.result.result.error.html b/docs/api/v2.0.0/en/folktale.result.result.error.html
      index 4de30d4..1a6a633 100644
      --- a/docs/api/v2.0.0/en/folktale.result.result.error.html
      +++ b/docs/api/v2.0.0/en/folktale.result.result.error.html
      @@ -8,7 +8,7 @@
         
         
           
           

      Error

      Constructs a Result whose value represents a failure.

      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.

      Signature

      Error(value)
      forall a, b: (a) => Result a b

      Documentation

      Constructs a Result whose value represents a failure.

      @@ -17,7 +17,7 @@
      Experimental

      Debugging

      inspect: toString()

      A textual representation of the Error variant.

      Experimental
      toString()

      A textual representation of the Error variant.

      Experimental

      Special values

      get constructor

      The constructor for this variant.

      -
      Experimental
      prototype

      The container for instance methods for Error variants of the Result structure.

      +
      Experimental
      prototype

      The container for instance methods for Error variants of the Result structure.

      Experimental
      get tag

      The tag for this variant, unique among the Result variants.

      Experimental
      get type

      The type for this variant, unique among Folktale data structures (and ideally unique among all unions in your application, as its used for type checking).

      Experimental

      Instance (prototype) properties

      Comparing and testing

      equals(value)

      Performs a deep-comparison of two Result values for equality. See adt/union/derivations/equality for details.

      @@ -53,26 +53,26 @@ [typeName]: adt }, keysIndicateType = false)

      Parses a JavaScript object previously serialised as aResult.toJSON() into a proper Result structure.

      ExperimentalInherited
      toJSON()

      Converts a Result value to a JavaScript object that may be stored as a JSON value.

      -
      Experimental

      Special values

      get constructor

      The constructor for this variant.

      +
      Experimental

      Special values

      get constructor

      The constructor for this variant.

      variants

      The variants in the Result structure.

      -
      ExperimentalInherited

      Transforming

      apply()

      Applies the function contained in one Result to the value in another Result. +

      ExperimentalInherited

      Transforming

      apply()

      Applies the function contained in one Result to the value in another Result. Application only occurs if both Results are Ok, otherwise keeps the first Error.

      -
      Experimental
      bimap()

      Transforms each side of a Result with a function, without changing the context +

      Experimental
      bimap()

      Transforms each side of a Result with a function, without changing the context of the computation. That is, Errors will still be Errors, Oks will still be Oks.

      -
      Experimental
      chain()

      Transforms the value and context of a Result computation with an unary function. +

      Experimental
      chain()

      Transforms the value and context of a Result computation with an unary function. As with .map(), the transformation is only applied if the value is an Ok, but the transformation is expected a new Result value, which then becomes the result of the method.

      -
      Experimental
      map()

      Transforms the value inside of a Result structure with an unary function without +

      Experimental
      map()

      Transforms the value inside of a Result structure with an unary function without changing the context of the computation. That is, Error values continue to be Error values, and Ok values continue to be Ok values.

      -
      Experimental
      mapError()

      Transforms the value inside an Error without changing the context of the +

      Experimental
      mapError()

      Transforms the value inside an Error without changing the context of the computation.

      Experimental

      Variants

      Error(value)

      Constructs a Result whose value represents a failure.

      ExperimentalInherited
      Ok(value)

      Constructs a Result whose value represents a success.

      -
      ExperimentalInherited

      (Uncategorised)

      Source Code

      Error(value) {
      +
      ExperimentalInherited

      (Uncategorised)

      Source Code

      Error(value) {
           return { value };
         }
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/result/result
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.result.result.fold.html b/docs/api/v2.0.0/en/folktale.result.result.fold.html index 928b629..25e792d 100644 --- a/docs/api/v2.0.0/en/folktale.result.result.fold.html +++ b/docs/api/v2.0.0/en/folktale.result.result.fold.html @@ -8,7 +8,7 @@

      fold

      Applies a function to each case of a Result.

      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.

      Signature

      forall a, b, c:
      diff --git a/docs/api/v2.0.0/en/folktale.result.result.get.html b/docs/api/v2.0.0/en/folktale.result.result.get.html
      index e7c6d50..ffba213 100644
      --- a/docs/api/v2.0.0/en/folktale.result.result.get.html
      +++ b/docs/api/v2.0.0/en/folktale.result.result.get.html
      @@ -8,7 +8,7 @@
         
         
           
           

      get

      This method has been renamed to unsafeGet().

      Deprecated since 2.0.0

      We want to discourage the use of partial functions, and having short names diff --git a/docs/api/v2.0.0/en/folktale.result.result.getorelse-1.html b/docs/api/v2.0.0/en/folktale.result.result.getorelse-1.html new file mode 100644 index 0000000..dd57a02 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.result.result.getorelse-1.html @@ -0,0 +1,47 @@ + + + + + getOrElse + + + + +

      +

      getOrElse

      Extracts the value of a Result structure, if it exists (i.e.: is an Ok), +otherwise returns the provided default value.

      +
      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.

      Signature

      forall a, b: (Result a b).(b) => b

      Documentation

      Extracts the value of a Result structure, if it exists (i.e.: is an Ok), +otherwise returns the provided default value.

      +

      Example:

      +
      const Result = require('folktale/result');
      +
      +Result.Ok(1).getOrElse(2);
      +// ==> 1
      +
      +Result.Error(1).getOrElse(2);
      +// ==> 2
      +

      Properties

      Source Code

      Defined in source/result/result.js at line 75, column 19
      {
      +    /*~*/
      +    Error: function getOrElse(_default) {
      +      return _default;
      +    },
      +
      +    /*~*/
      +    Ok: function getOrElse(_default) {
      +      return this.value;
      +    }
      +  }
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/result/result
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.result.result.getorelse.html b/docs/api/v2.0.0/en/folktale.result.result.getorelse.html index 3240d36..dd57a02 100644 --- a/docs/api/v2.0.0/en/folktale.result.result.getorelse.html +++ b/docs/api/v2.0.0/en/folktale.result.result.getorelse.html @@ -8,7 +8,7 @@

      getOrElse

      Extracts the value of a Result structure, if it exists (i.e.: is an Ok), otherwise returns the provided default value.

      diff --git a/docs/api/v2.0.0/en/folktale.result.result.inspect-1.html b/docs/api/v2.0.0/en/folktale.result.result.inspect-1.html new file mode 100644 index 0000000..22abb83 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.result.result.inspect-1.html @@ -0,0 +1,26 @@ + + + + + toString + + + + + +

      toString

      A textual representation of the Ok variant.

      +
      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.

      Signature

      toString()
      () => String

      Documentation

      A textual representation of the Ok variant.

      +

      Properties

      Source Code

      () => variantName
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/result/result
      On This Page
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • @boris-marinov
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.result.result.inspect.html b/docs/api/v2.0.0/en/folktale.result.result.inspect.html index d113b37..6afddef 100644 --- a/docs/api/v2.0.0/en/folktale.result.result.inspect.html +++ b/docs/api/v2.0.0/en/folktale.result.result.inspect.html @@ -8,10 +8,10 @@ -

      toString

      A textual representation of the Ok variant.

      -
      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.

      Signature

      toString()
      () => String

      Documentation

      A textual representation of the Ok variant.

      +

      toString

      A textual representation of the Error variant.

      +
      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.

      Signature

      toString()
      () => String

      Documentation

      A textual representation of the Error variant.

      Properties

      Source Code

      () => variantName
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/result/result
      On This Page
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • @boris-marinov
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.result.result.map.html b/docs/api/v2.0.0/en/folktale.result.result.map.html index 0fe8ab1..c00b973 100644 --- a/docs/api/v2.0.0/en/folktale.result.result.map.html +++ b/docs/api/v2.0.0/en/folktale.result.result.map.html @@ -8,7 +8,7 @@

      map

      Transforms the value inside of a Result structure with an unary function without changing the context of the computation. That is, Error values continue to be diff --git a/docs/api/v2.0.0/en/folktale.result.result.maperror-1.html b/docs/api/v2.0.0/en/folktale.result.result.maperror-1.html new file mode 100644 index 0000000..2671d40 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.result.result.maperror-1.html @@ -0,0 +1,51 @@ + + + + + mapError + + + + +

      +

      mapError

      Transforms the value inside an Error without changing the context of the +computation.

      +
      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.

      Signature

      forall a, b, c:
      +  (Result a b).((a) => c) => Result c b

      Documentation

      Transforms the value inside an Error without changing the context of the +computation.

      +

      This is similar to .map, except it operates on Errors instead of Oks.

      +

      Example:

      +
      const Result = require('folktale/result');
      +
      +Result.Error(1).mapError(x => x + 1);
      +// ==> Result.Error(2)
      +
      +Result.Ok(1).mapError(x => x + 1);
      +// ==> Result.Ok(1)
      +

      Properties

      Source Code

      Defined in source/result/result.js at line 75, column 19
      {
      +    /*~*/
      +    Error: function mapError(f) {
      +      assertFunction('Result.Error#mapError', f);
      +      return Error(f(this.value));
      +    },
      +
      +    /*~*/
      +    Ok: function mapError(f) {
      +      assertFunction('Result.Ok#mapError', f);
      +      return this;
      +    }
      +  }
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/result/result
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.result.result.maperror.html b/docs/api/v2.0.0/en/folktale.result.result.maperror.html index c1e6f3c..2671d40 100644 --- a/docs/api/v2.0.0/en/folktale.result.result.maperror.html +++ b/docs/api/v2.0.0/en/folktale.result.result.maperror.html @@ -8,7 +8,7 @@

      mapError

      Transforms the value inside an Error without changing the context of the computation.

      diff --git a/docs/api/v2.0.0/en/folktale.result.result.merge.html b/docs/api/v2.0.0/en/folktale.result.result.merge.html index 912ddf9..4f2bb9e 100644 --- a/docs/api/v2.0.0/en/folktale.result.result.merge.html +++ b/docs/api/v2.0.0/en/folktale.result.result.merge.html @@ -8,7 +8,7 @@

      merge

      Returns the value inside of the Result structure, regardless of its state.

      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.

      Signature

      merge()
      forall a, b: (Result a b).() => a or b

      Documentation

      Returns the value inside of the Result structure, regardless of its state.

      diff --git a/docs/api/v2.0.0/en/folktale.result.result.of.html b/docs/api/v2.0.0/en/folktale.result.result.of.html index ebaacc0..9f2d66b 100644 --- a/docs/api/v2.0.0/en/folktale.result.result.of.html +++ b/docs/api/v2.0.0/en/folktale.result.result.of.html @@ -8,7 +8,7 @@

      of

      Constructs a Result holding an Ok value.

      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.

      Signature

      of(value)
      forall a, b: (b) => Result a b

      Documentation

      Constructs a Result holding an Ok value.

      diff --git a/docs/api/v2.0.0/en/folktale.result.result.orelse-1.html b/docs/api/v2.0.0/en/folktale.result.result.orelse-1.html new file mode 100644 index 0000000..ea17c73 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.result.result.orelse-1.html @@ -0,0 +1,55 @@ + + + + + orElse + + + + + +

      orElse

      Allows recovering from Error values with a handler function.

      +
      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.

      Signature

      forall a, b, c:
      +  (Result a b).((a) => Result c b) => Result c b

      Documentation

      Allows recovering from Error values with a handler function.

      +

      While .chain() allows one to sequence operations, such that the second +operation is ran only if the first one succeeds, the .orElse() method allows +one to recover from an Error by running a function that provides a new Result +value.

      +

      Example:

      +
      const Result = require('folktale/result');
      +
      +Result.Ok(4).orElse(error => Result.Ok(error + 1));
      +// ==> Result.Ok(4)
      +
      +Result.Error(4).orElse(error => Result.Ok(error + 1));
      +// ==> Result.Ok(5)
      +
      +Result.Error(4).orElse(error => Result.Error(error - 1));
      +// ==> Result.Error(3)
      +

      Properties

      Source Code

      Defined in source/result/result.js at line 75, column 19
      {
      +    /*~*/
      +    Error: function orElse(handler) {
      +      assertFunction('Result.Error#orElse', handler);
      +      return handler(this.value);
      +    },
      +
      +    /*~*/
      +    Ok: function orElse(handler) {
      +      assertFunction('Result.Ok#orElse', handler);
      +      return this;
      +    }
      +  }
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/result/result
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.result.result.orelse.html b/docs/api/v2.0.0/en/folktale.result.result.orelse.html index 704e0be..ea17c73 100644 --- a/docs/api/v2.0.0/en/folktale.result.result.orelse.html +++ b/docs/api/v2.0.0/en/folktale.result.result.orelse.html @@ -8,7 +8,7 @@

      orElse

      Allows recovering from Error values with a handler function.

      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.

      Signature

      forall a, b, c:
      diff --git a/docs/api/v2.0.0/en/folktale.result.result.swap-1.html b/docs/api/v2.0.0/en/folktale.result.result.swap-1.html
      new file mode 100644
      index 0000000..021134e
      --- /dev/null
      +++ b/docs/api/v2.0.0/en/folktale.result.result.swap-1.html
      @@ -0,0 +1,49 @@
      +
      +
      +
      +  
      +    swap
      +    
      +    
      +  
      +  
      +    
      +    

      swap

      Inverts the context of a Result value such that Errors are transformed into Oks, +and Oks are transformed into Errors. Does not touch the value inside of the +Result.

      +
      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.

      Signature

      forall a, b: (Result a b).() => Result b a

      Documentation

      Inverts the context of a Result value such that Errors are transformed into Oks, +and Oks are transformed into Errors. Does not touch the value inside of the +Result.

      +

      Example:

      +
      const Result = require('folktale/result');
      +
      +Result.Ok(1).swap();
      +// ==> Result.Error(1)
      +
      +Result.Error(1).swap();
      +// ==> Result.Ok(1)
      +

      Properties

      Source Code

      Defined in source/result/result.js at line 75, column 19
      {
      +    /*~*/
      +    Error: function swap() {
      +      return Ok(this.value);
      +    },
      +
      +    /*~*/
      +    Ok: function swap() {
      +      return Error(this.value);
      +    }
      +  }
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/result/result
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.result.result.swap.html b/docs/api/v2.0.0/en/folktale.result.result.swap.html index 59ac199..021134e 100644 --- a/docs/api/v2.0.0/en/folktale.result.result.swap.html +++ b/docs/api/v2.0.0/en/folktale.result.result.swap.html @@ -8,7 +8,7 @@

      swap

      Inverts the context of a Result value such that Errors are transformed into Oks, and Oks are transformed into Errors. Does not touch the value inside of the diff --git a/docs/api/v2.0.0/en/folktale.result.result.tomaybe.html b/docs/api/v2.0.0/en/folktale.result.result.tomaybe.html index eb3ed1d..c75bb91 100644 --- a/docs/api/v2.0.0/en/folktale.result.result.tomaybe.html +++ b/docs/api/v2.0.0/en/folktale.result.result.tomaybe.html @@ -8,7 +8,7 @@

      toMaybe

      Transforms a Result into a Maybe. Error values are lost in the process.

      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.

      Signature

      toMaybe()
      forall a, b: (Result a b).() => Maybe b

      Documentation

      Transforms a Result into a Maybe. Error values are lost in the process.

      diff --git a/docs/api/v2.0.0/en/folktale.result.result.tovalidation.html b/docs/api/v2.0.0/en/folktale.result.result.tovalidation.html index 083fb75..ef76667 100644 --- a/docs/api/v2.0.0/en/folktale.result.result.tovalidation.html +++ b/docs/api/v2.0.0/en/folktale.result.result.tovalidation.html @@ -8,7 +8,7 @@

      toValidation

      Transforms a Result into a Validation.

      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.

      Signature

      toValidation()
      forall a, b: (Result a b).() => Validation a b

      Documentation

      Transforms a Result into a Validation.

      diff --git a/docs/api/v2.0.0/en/folktale.result.result.unsafeget-1.html b/docs/api/v2.0.0/en/folktale.result.result.unsafeget-1.html new file mode 100644 index 0000000..35729e2 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.result.result.unsafeget-1.html @@ -0,0 +1,60 @@ + + + + + unsafeGet + + + + + +

      unsafeGet

      Extracts the value from a Result structure.

      +
      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.

      Signature

      forall a, b: (Result a b).() => b :: throws TypeError

      Documentation

      Extracts the value from a Result structure.

      +
      +

      WARNING
      This method is partial, which means that it will only work for Ok +structures, not for Error structures. It's recommended to use .getOrElse() +or .matchWith() instead.

      +
      +

      Example:

      +
      const Result = require('folktale/result');
      +
      +Result.Ok(1).unsafeGet();
      +// ==> 1
      +
      +
      +try {
      +  Result.Error(1).unsafeGet();
      +  // TypeError: Can't extract the value of an Error
      +} catch (e) {
      +  e instanceof TypeError; // ==> true
      +}
      +

      Properties

      Source Code

      Defined in source/result/result.js at line 75, column 19
      {
      +    /*~*/
      +    Error: function unsafeGet() {
      +      throw new TypeError(`Can't extract the value of an Error.
      +
      +Error does not contain a normal value - it contains an error.
      +You might consider switching from Result#unsafeGet to Result#getOrElse,
      +or some other method that is not partial.
      +      `);
      +    },
      +
      +    /*~*/
      +    Ok: function unsafeGet() {
      +      return this.value;
      +    }
      +  }
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/result/result
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.result.result.unsafeget.html b/docs/api/v2.0.0/en/folktale.result.result.unsafeget.html index c378774..35729e2 100644 --- a/docs/api/v2.0.0/en/folktale.result.result.unsafeget.html +++ b/docs/api/v2.0.0/en/folktale.result.result.unsafeget.html @@ -8,7 +8,7 @@

      unsafeGet

      Extracts the value from a Result structure.

      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.

      Signature

      forall a, b: (Result a b).() => b :: throws TypeError

      Documentation

      Extracts the value from a Result structure.

      diff --git a/docs/api/v2.0.0/en/folktale.result.result.value-1.html b/docs/api/v2.0.0/en/folktale.result.result.value-1.html new file mode 100644 index 0000000..766e800 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.result.result.value-1.html @@ -0,0 +1,38 @@ + + + + + value + + + + + +

      value

      The value contained in an Ok instance of the Result structure.

      +

      Signature

      get value()
      forall a, b: get (Result a b) => b

      Documentation

      The value contained in an Ok instance of the Result structure.

      +

      This is usually used to destructure the instance in a .matchWith call.

      +

      Example:

      +
      const Result = require('folktale/result');
      +
      +Result.Ok(1).matchWith({
      +  Error: ({ value }) => 'nothing',
      +  Ok:    ({ value }) => value    // equivalent to (x) => x.value
      +});
      +// ==> 1
      +

      Properties

      Source Code

      Defined in source/result/result.js at line 60, column 21
      get value() {
      +    throw new TypeError('`value` can’t be accessed in an abstract instance of Result.Ok');
      +  }
      Licence
      MIT
      Module
      folktale/result/result
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.result.result.value.html b/docs/api/v2.0.0/en/folktale.result.result.value.html index 2ffc93e..f7278ee 100644 --- a/docs/api/v2.0.0/en/folktale.result.result.value.html +++ b/docs/api/v2.0.0/en/folktale.result.result.value.html @@ -8,21 +8,21 @@ -

      value

      The value contained in an Ok instance of the Result structure.

      -

      Signature

      get value()
      forall a, b: get (Result a b) => b

      Documentation

      The value contained in an Ok instance of the Result structure.

      +

      value

      The value contained in an Error instance of the Result structure.

      +

      Signature

      get value()
      forall a, b: get (Result a b) => a

      Documentation

      The value contained in an Error instance of the Result structure.

      This is usually used to destructure the instance in a .matchWith call.

      Example:

      const Result = require('folktale/result');
       
      -Result.Ok(1).matchWith({
      -  Error: ({ value }) => 'nothing',
      -  Ok:    ({ value }) => value    // equivalent to (x) => x.value
      +Result.Error(1).matchWith({
      +  Error: ({ value }) => value,    // equivalent to (x) => x.value
      +  Ok:    ({ value }) => 'nothing'
       });
       // ==> 1
      -

      Properties

      Source Code

      Defined in source/result/result.js at line 60, column 21
      get value() {
      -    throw new TypeError('`value` can’t be accessed in an abstract instance of Result.Ok');
      +

      Properties

      Source Code

      Defined in source/result/result.js at line 48, column 24
      get value() {
      +    throw new TypeError('`value` can’t be accessed in an abstract instance of Result.Error');
         }
      Licence
      MIT
      Module
      folktale/result/result
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.validation.validation.apply.html b/docs/api/v2.0.0/en/folktale.validation.validation.apply.html index b348754..3f583bc 100644 --- a/docs/api/v2.0.0/en/folktale.validation.validation.apply.html +++ b/docs/api/v2.0.0/en/folktale.validation.validation.apply.html @@ -8,7 +8,7 @@

      apply

      If successes, applies the function in one Validation to another. Otherwise concatenate the failures.

      Signature

      forall a, b, c: (Validation (b) => c).(Validation a b) => Validation a c

      Documentation

      If successes, applies the function in one Validation to another. Otherwise concatenate the failures.

      diff --git a/docs/api/v2.0.0/en/folktale.validation.validation.bimap-1.html b/docs/api/v2.0.0/en/folktale.validation.validation.bimap-1.html new file mode 100644 index 0000000..7d54d93 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.validation.validation.bimap-1.html @@ -0,0 +1,53 @@ + + + + + bimap + + + + + +

      bimap

      Transforms each side of a Validation with a function, without changing the status of the validation. That is, failures will still be failures, successes will still be successes.

      +

      Signature

      forall a, b, c, d:
      +  (Validation a b).((a) => c, (b) => d) => Validation c d

      Documentation

      Transforms each side of a Validation with a function, without changing the status of the validation. That is, failures will still be failures, successes will still be successes.

      +

      Example:

      +
      const Validation = require('folktale/validation');
      +
      +const upcase = (a) => a.toUpperCase();
      +const duplicate = (a) => `${a}${a}`;
      +
      +Validation.Success('a').bimap(duplicate, upcase);
      +// ==> Validation.Success('A')
      +
      +Validation.Failure('a').bimap(duplicate, upcase);
      +// ==> Validation.Failure('aa')
      +

      Properties

      Source Code

      Defined in source/validation/validation.js at line 70, column 23
      {
      +    /*~*/
      +    Failure: function bimap(failureTransformation, successTransformation) {
      +      assertFunction('Validation.Failure#fold', failureTransformation);
      +      assertFunction('Validation.Failure#fold', successTransformation);
      +      return Failure(failureTransformation(this.value));
      +    },
      +
      +    /*~*/
      +    Success: function bimap(failureTransformation, successTransformation) {
      +      assertFunction('Validation.Success#fold', failureTransformation);
      +      assertFunction('Validation.Success#fold', successTransformation);
      +      return Success(successTransformation(this.value));
      +    }
      +  }
      Licence
      MIT
      Module
      folktale/validation/validation
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.validation.validation.bimap.html b/docs/api/v2.0.0/en/folktale.validation.validation.bimap.html index 2c896c6..7d54d93 100644 --- a/docs/api/v2.0.0/en/folktale.validation.validation.bimap.html +++ b/docs/api/v2.0.0/en/folktale.validation.validation.bimap.html @@ -8,7 +8,7 @@

      bimap

      Transforms each side of a Validation with a function, without changing the status of the validation. That is, failures will still be failures, successes will still be successes.

      Signature

      forall a, b, c, d:
      diff --git a/docs/api/v2.0.0/en/folktale.validation.validation.concat-1.html b/docs/api/v2.0.0/en/folktale.validation.validation.concat-1.html
      new file mode 100644
      index 0000000..a4ffd0e
      --- /dev/null
      +++ b/docs/api/v2.0.0/en/folktale.validation.validation.concat-1.html
      @@ -0,0 +1,60 @@
      +
      +
      +
      +  
      +    concat
      +    
      +    
      +  
      +  
      +    
      +    

      concat

      Combines two validations together such that failures are aggregated.

      +

      Signature

      forall a, b:
      +  (Validation a b).(Validation a b) => Validation a b
      +where a is Semigroup

      Documentation

      Combines two validations together such that failures are aggregated.

      +

      In cases where both validations contain a successful value, this method just selects the last validation.

      +

      Example:

      +
      const { Success, Failure } = require('folktale/validation');
      +
      +Failure('a').concat(Failure('b'));
      +// ==> Failure('ab')
      +
      +Failure('a').concat(Success('b'));
      +// ==> Failure('a')
      +
      +Success('a').concat(Failure('b'));
      +// ==> Failure('b')
      +
      +Success('a').concat(Success('b'));
      +// ==> Success('b')
      +

      Properties

      Source Code

      Defined in source/validation/validation.js at line 70, column 23
      {
      +    /*~*/
      +    Failure: function concat(aValidation) {
      +      assertValidation('Validation.Failure#concat', aValidation);
      +      if (Failure.hasInstance(aValidation)) {
      +        return Failure(this.value.concat(aValidation.value));
      +      } else {
      +        return this;
      +      }
      +    },
      +
      +    /*~*/
      +    Success: function concat(aValidation) {
      +      assertValidation('Validation.Success#concat', aValidation);
      +      return aValidation;
      +    }
      +  }
      Licence
      MIT
      Module
      folktale/validation/validation
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.validation.validation.concat.html b/docs/api/v2.0.0/en/folktale.validation.validation.concat.html index a8fbcd4..a4ffd0e 100644 --- a/docs/api/v2.0.0/en/folktale.validation.validation.concat.html +++ b/docs/api/v2.0.0/en/folktale.validation.validation.concat.html @@ -8,7 +8,7 @@

      concat

      Combines two validations together such that failures are aggregated.

      Signature

      forall a, b:
      diff --git a/docs/api/v2.0.0/en/folktale.validation.validation.failure.html b/docs/api/v2.0.0/en/folktale.validation.validation.failure.html
      index c44bd17..d48bf92 100644
      --- a/docs/api/v2.0.0/en/folktale.validation.validation.failure.html
      +++ b/docs/api/v2.0.0/en/folktale.validation.validation.failure.html
      @@ -8,7 +8,7 @@
         
         
           
           

      Failure

      Constructs a Validation whose value represents a failure.

      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.

      Signature

      Failure(value)
      forall a, b: (a) => Validation a b

      Documentation

      Constructs a Validation whose value represents a failure.

      @@ -17,7 +17,7 @@
      Experimental

      Debugging

      inspect: toString()

      A textual representation of the Failure variant.

      Experimental
      toString()

      A textual representation of the Failure variant.

      Experimental

      Special values

      get constructor

      The constructor for this variant.

      -
      Experimental
      prototype

      The container for instance methods for Failure variants of the Validation structure.

      +
      Experimental
      prototype

      The container for instance methods for Failure variants of the Validation structure.

      Experimental
      get tag

      The tag for this variant, unique among the Validation variants.

      Experimental
      get type

      The type for this variant, unique among Folktale data structures (and ideally unique among all unions in your application, as its used for type checking).

      Experimental

      Instance (prototype) properties

      Combining validations

      apply()

      If successes, applies the function in one Validation to another. Otherwise concatenate the failures.

      @@ -51,11 +51,11 @@ [typeName]: adt }, keysIndicateType = false)

      Parses a JavaScript object previously serialised as aValidation.toJSON() into a proper Validation structure.

      ExperimentalInherited
      toJSON()

      Converts a Validation value to a JavaScript object that may be stored as a JSON value.

      -
      Experimental

      Special values

      get constructor

      The constructor for this variant.

      +
      Experimental

      Special values

      get constructor

      The constructor for this variant.

      variants

      The variants in the Validation structure.

      -
      ExperimentalInherited

      Transforming

      bimap()

      Transforms each side of a Validation with a function, without changing the status of the validation. That is, failures will still be failures, successes will still be successes.

      -
      map()

      Transforms the successful value inside a Validation structure with an unary function without changing the status of the validation. That is, Success values continue to be Success values, Failure values continue to be Failure values.

      -
      mapFailure()

      Transforms the failure value inside a Validation structure with an unary function without changing the status of the validation. That is, Success values continue to be Success values, Failure values continue to be Failure values.

      +
      ExperimentalInherited

      Transforming

      bimap()

      Transforms each side of a Validation with a function, without changing the status of the validation. That is, failures will still be failures, successes will still be successes.

      +
      map()

      Transforms the successful value inside a Validation structure with an unary function without changing the status of the validation. That is, Success values continue to be Success values, Failure values continue to be Failure values.

      +
      mapFailure()

      Transforms the failure value inside a Validation structure with an unary function without changing the status of the validation. That is, Success values continue to be Success values, Failure values continue to be Failure values.

      Variants

      Failure(value)

      Constructs a Validation whose value represents a failure.

      ExperimentalInherited
      Success(value)

      Constructs a Validation whose value represents a success.

      ExperimentalInherited

      Source Code

      Failure(value) { 
      diff --git a/docs/api/v2.0.0/en/folktale.validation.validation.fold-1.html b/docs/api/v2.0.0/en/folktale.validation.validation.fold-1.html
      new file mode 100644
      index 0000000..dc95eed
      --- /dev/null
      +++ b/docs/api/v2.0.0/en/folktale.validation.validation.fold-1.html
      @@ -0,0 +1,53 @@
      +
      +
      +
      +  
      +    fold
      +    
      +    
      +  
      +  
      +    
      +    

      fold

      Applies a function to each case of a Validation.

      +

      Signature

      forall a, b, c:
      +  (Validation a b).((a) => c, (b) => c) => c

      Documentation

      Applies a function to each case of a Validation.

      +

      Example:

      +
      const { Success, Failure } = require('folktale/validation');
      +
      +const upcase = (x) => x.toUpperCase();
      +const double = (x) => x + x;
      +
      +Success('a').fold(upcase, double);
      +// ==> 'aa'
      +
      +Failure('a').fold(upcase, double);
      +// ==> 'A'
      +

      Properties

      Source Code

      Defined in source/validation/validation.js at line 70, column 23
      {
      +    /*~*/
      +    Failure: function fold(failureTransformation, successTransformation) {
      +      assertFunction('Validation.Failure#fold', failureTransformation);
      +      assertFunction('Validation.Failure#fold', successTransformation);
      +      return failureTransformation(this.value);
      +    },
      +
      +    /*~*/
      +    Success: function fold(failureTransformation, successTransformation) {
      +      assertFunction('Validation.Success#fold', failureTransformation);
      +      assertFunction('Validation.Success#fold', successTransformation);
      +      return successTransformation(this.value);
      +    }
      +  }
      Licence
      MIT
      Module
      folktale/validation/validation
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.validation.validation.fold.html b/docs/api/v2.0.0/en/folktale.validation.validation.fold.html index 8a1f9b2..dc95eed 100644 --- a/docs/api/v2.0.0/en/folktale.validation.validation.fold.html +++ b/docs/api/v2.0.0/en/folktale.validation.validation.fold.html @@ -8,7 +8,7 @@

      fold

      Applies a function to each case of a Validation.

      Signature

      forall a, b, c:
      diff --git a/docs/api/v2.0.0/en/folktale.validation.validation.get.html b/docs/api/v2.0.0/en/folktale.validation.validation.get.html
      index 2675148..63eea86 100644
      --- a/docs/api/v2.0.0/en/folktale.validation.validation.get.html
      +++ b/docs/api/v2.0.0/en/folktale.validation.validation.get.html
      @@ -8,7 +8,7 @@
         
         
           
           

      get

      This method has been renamed to unsafeGet().

      Deprecated since 2.0.0

      We want to discourage the use of partial functions, and having short names diff --git a/docs/api/v2.0.0/en/folktale.validation.validation.getorelse-1.html b/docs/api/v2.0.0/en/folktale.validation.validation.getorelse-1.html new file mode 100644 index 0000000..9e8a98f --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.validation.validation.getorelse-1.html @@ -0,0 +1,45 @@ + + + + + getOrElse + + + + +

      +

      getOrElse

      Extracts the value of a Validation structure, if it's a Success, otherwise returns the provided default value.

      +

      Signature

      forall a, b: (Validation a b).(b) => b

      Documentation

      Extracts the value of a Validation structure, if it's a Success, otherwise returns the provided default value.

      +

      Example:

      +
      const { Success, Failure } = require('folktale/validation');
      +
      +Success('a').getOrElse('b');
      +// ==> 'a'
      +
      +Failure('a').getOrElse('b');
      +// ==> 'b'
      +

      Properties

      Source Code

      Defined in source/validation/validation.js at line 70, column 23
      {
      +    /*~*/
      +    Failure: function getOrElse(_default) {
      +      return _default;
      +    },
      +
      +    /*~*/
      +    Success: function getOrElse(_default) {
      +      return this.value;
      +    }
      +  }
      Licence
      MIT
      Module
      folktale/validation/validation
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.validation.validation.getorelse.html b/docs/api/v2.0.0/en/folktale.validation.validation.getorelse.html index 6b194b1..9e8a98f 100644 --- a/docs/api/v2.0.0/en/folktale.validation.validation.getorelse.html +++ b/docs/api/v2.0.0/en/folktale.validation.validation.getorelse.html @@ -8,7 +8,7 @@

      getOrElse

      Extracts the value of a Validation structure, if it's a Success, otherwise returns the provided default value.

      Signature

      forall a, b: (Validation a b).(b) => b

      Documentation

      Extracts the value of a Validation structure, if it's a Success, otherwise returns the provided default value.

      diff --git a/docs/api/v2.0.0/en/folktale.validation.validation.inspect-1.html b/docs/api/v2.0.0/en/folktale.validation.validation.inspect-1.html new file mode 100644 index 0000000..0ead86f --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.validation.validation.inspect-1.html @@ -0,0 +1,26 @@ + + + + + toString + + + + + +

      toString

      A textual representation of the Success variant.

      +
      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.

      Signature

      toString()
      () => String

      Documentation

      A textual representation of the Success variant.

      +

      Properties

      Source Code

      () => variantName
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/validation/validation
      On This Page
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • @boris-marinov
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.validation.validation.inspect.html b/docs/api/v2.0.0/en/folktale.validation.validation.inspect.html index 852cacf..7dea5be 100644 --- a/docs/api/v2.0.0/en/folktale.validation.validation.inspect.html +++ b/docs/api/v2.0.0/en/folktale.validation.validation.inspect.html @@ -8,10 +8,10 @@ -

      toString

      A textual representation of the Success variant.

      -
      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.

      Signature

      toString()
      () => String

      Documentation

      A textual representation of the Success variant.

      +

      toString

      A textual representation of the Failure variant.

      +
      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.

      Signature

      toString()
      () => String

      Documentation

      A textual representation of the Failure variant.

      Properties

      Source Code

      () => variantName
      Stability
      experimental
      Licence
      MIT
      Module
      folktale/validation/validation
      On This Page
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • @boris-marinov
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.validation.validation.map.html b/docs/api/v2.0.0/en/folktale.validation.validation.map.html index 70d57dc..185b904 100644 --- a/docs/api/v2.0.0/en/folktale.validation.validation.map.html +++ b/docs/api/v2.0.0/en/folktale.validation.validation.map.html @@ -8,7 +8,7 @@

      map

      Transforms the successful value inside a Validation structure with an unary function without changing the status of the validation. That is, Success values continue to be Success values, Failure values continue to be Failure values.

      Signature

      forall a, b, c: (Validation a b).((b) => c) => Validation a c

      Documentation

      Transforms the successful value inside a Validation structure with an unary function without changing the status of the validation. That is, Success values continue to be Success values, Failure values continue to be Failure values.

      diff --git a/docs/api/v2.0.0/en/folktale.validation.validation.mapfailure-1.html b/docs/api/v2.0.0/en/folktale.validation.validation.mapfailure-1.html new file mode 100644 index 0000000..e8106fd --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.validation.validation.mapfailure-1.html @@ -0,0 +1,50 @@ + + + + + mapFailure + + + + + +

      mapFailure

      Transforms the failure value inside a Validation structure with an unary function without changing the status of the validation. That is, Success values continue to be Success values, Failure values continue to be Failure values.

      +

      Signature

      forall a, b, c:
      +  (Validation a b).((a) => c) Validation c b

      Documentation

      Transforms the failure value inside a Validation structure with an unary function without changing the status of the validation. That is, Success values continue to be Success values, Failure values continue to be Failure values.

      +

      Example:

      +
      const { Success, Failure } = require('folktale/validation');
      +
      +const upcase = (a) => a.toUpperCase();
      +
      +Success('a').mapFailure(upcase);
      +// ==> Success('a')
      +
      +Failure('a').mapFailure(upcase);
      +// ==> Failure('A')
      +

      Properties

      Source Code

      Defined in source/validation/validation.js at line 70, column 23
      {
      +    /*~*/
      +    Failure: function mapFailure(transformation) {
      +      assertFunction('Validation.Failure#mapFailure', transformation);
      +      return Failure(transformation(this.value));
      +    },
      +
      +    /*~*/
      +    Success: function mapFailure(transformation) {
      +      assertFunction('Validation.Failure#mapFailure', transformation);
      +      return this;
      +    }
      +  }
      Licence
      MIT
      Module
      folktale/validation/validation
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.validation.validation.mapfailure.html b/docs/api/v2.0.0/en/folktale.validation.validation.mapfailure.html index 1b276ca..e8106fd 100644 --- a/docs/api/v2.0.0/en/folktale.validation.validation.mapfailure.html +++ b/docs/api/v2.0.0/en/folktale.validation.validation.mapfailure.html @@ -8,7 +8,7 @@

      mapFailure

      Transforms the failure value inside a Validation structure with an unary function without changing the status of the validation. That is, Success values continue to be Success values, Failure values continue to be Failure values.

      Signature

      forall a, b, c:
      diff --git a/docs/api/v2.0.0/en/folktale.validation.validation.merge.html b/docs/api/v2.0.0/en/folktale.validation.validation.merge.html
      index 840377c..e4fd801 100644
      --- a/docs/api/v2.0.0/en/folktale.validation.validation.merge.html
      +++ b/docs/api/v2.0.0/en/folktale.validation.validation.merge.html
      @@ -8,7 +8,7 @@
         
         
           
           

      merge

      Returns the value inside of the Validation structure, regardless of its state.

      Signature

      merge()
      forall a, b: (Validation a b).() => a or b

      Documentation

      Returns the value inside of the Validation structure, regardless of its state.

      diff --git a/docs/api/v2.0.0/en/folktale.validation.validation.of.html b/docs/api/v2.0.0/en/folktale.validation.validation.of.html index 2fcad5a..7ef237b 100644 --- a/docs/api/v2.0.0/en/folktale.validation.validation.of.html +++ b/docs/api/v2.0.0/en/folktale.validation.validation.of.html @@ -8,7 +8,7 @@

      of

      Constructs a Validation holding a Success value.

      Signature

      of(value)
      forall a, b: (b) => Validation a b

      Documentation

      Constructs a Validation holding a Success value.

      diff --git a/docs/api/v2.0.0/en/folktale.validation.validation.orelse-1.html b/docs/api/v2.0.0/en/folktale.validation.validation.orelse-1.html new file mode 100644 index 0000000..72268a7 --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.validation.validation.orelse-1.html @@ -0,0 +1,51 @@ + + + + + orElse + + + + + +

      orElse

      Allows recovering from Failure values with a handler function.

      +

      Signature

      forall a, b, c:
      +  (Validation a b).((a) => Validation c b) => Validation c b

      Documentation

      Allows recovering from Failure values with a handler function.

      +

      Example:

      +
      const { Success, Failure } = require('folktale/validation');
      +
      +Success('a').orElse(e => Success('b'));
      +// ==> Success('a')
      +
      +Failure('a').orElse(e => Success('b'));
      +// ==> Success('b')
      +
      +Failure('a').orElse(e => Failure('b'));
      +// ==> Failure('b')
      +

      Properties

      Source Code

      Defined in source/validation/validation.js at line 70, column 23
      {
      +    /*~*/
      +    Failure: function orElse(handler) {
      +      assertFunction('Validation.Failure#orElse', handler);
      +      return handler(this.value);
      +    },
      +
      +    /*~*/
      +    Success: function orElse(handler) {
      +      assertFunction('Validation.Success#orElse', handler);
      +      return this;
      +    }
      +  }
      Licence
      MIT
      Module
      folktale/validation/validation
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.validation.validation.orelse.html b/docs/api/v2.0.0/en/folktale.validation.validation.orelse.html index dc1c4e0..72268a7 100644 --- a/docs/api/v2.0.0/en/folktale.validation.validation.orelse.html +++ b/docs/api/v2.0.0/en/folktale.validation.validation.orelse.html @@ -8,7 +8,7 @@

      orElse

      Allows recovering from Failure values with a handler function.

      Signature

      forall a, b, c:
      diff --git a/docs/api/v2.0.0/en/folktale.validation.validation.swap-1.html b/docs/api/v2.0.0/en/folktale.validation.validation.swap-1.html
      new file mode 100644
      index 0000000..81a2037
      --- /dev/null
      +++ b/docs/api/v2.0.0/en/folktale.validation.validation.swap-1.html
      @@ -0,0 +1,45 @@
      +
      +
      +
      +  
      +    swap
      +    
      +    
      +  
      +  
      +    
      +    

      swap

      Inverts the status of a Validation, such that Failures become Successes, and vice-versa.

      +

      Signature

      forall a, b: (Validation a b).() => Validation b a

      Documentation

      Inverts the status of a Validation, such that Failures become Successes, and vice-versa.

      +

      Example:

      +
      const { Success, Failure } = require('folktale/validation');
      +
      +Success('a').swap();
      +// ==> Failure('a')
      +
      +Failure('a').swap();
      +// ==> Success('a')
      +

      Properties

      Source Code

      Defined in source/validation/validation.js at line 70, column 23
      {
      +    /*~*/
      +    Failure: function swap() {
      +      return Success(this.value);
      +    },
      +
      +    /*~*/
      +    Success: function swap() {
      +      return Failure(this.value);
      +    }
      +  }
      Licence
      MIT
      Module
      folktale/validation/validation
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.validation.validation.swap.html b/docs/api/v2.0.0/en/folktale.validation.validation.swap.html index 6c74032..81a2037 100644 --- a/docs/api/v2.0.0/en/folktale.validation.validation.swap.html +++ b/docs/api/v2.0.0/en/folktale.validation.validation.swap.html @@ -8,7 +8,7 @@

      swap

      Inverts the status of a Validation, such that Failures become Successes, and vice-versa.

      Signature

      forall a, b: (Validation a b).() => Validation b a

      Documentation

      Inverts the status of a Validation, such that Failures become Successes, and vice-versa.

      diff --git a/docs/api/v2.0.0/en/folktale.validation.validation.tomaybe.html b/docs/api/v2.0.0/en/folktale.validation.validation.tomaybe.html index a7173ae..f8256c5 100644 --- a/docs/api/v2.0.0/en/folktale.validation.validation.tomaybe.html +++ b/docs/api/v2.0.0/en/folktale.validation.validation.tomaybe.html @@ -8,7 +8,7 @@

      toMaybe

      Transforms a Validation into a Maybe. Failure values are lost in the process.

      Signature

      toMaybe()
      forall a, b: (Validation a b).() => Maybe b

      Documentation

      Transforms a Validation into a Maybe. Failure values are lost in the process.

      diff --git a/docs/api/v2.0.0/en/folktale.validation.validation.toresult.html b/docs/api/v2.0.0/en/folktale.validation.validation.toresult.html index ebe1382..a8b8247 100644 --- a/docs/api/v2.0.0/en/folktale.validation.validation.toresult.html +++ b/docs/api/v2.0.0/en/folktale.validation.validation.toresult.html @@ -8,7 +8,7 @@

      toResult

      Transforms a Validation into a Reseult.

      Signature

      toResult()
      forall a, b: (Validation a b).() => Result a b

      Documentation

      Transforms a Validation into a Reseult.

      diff --git a/docs/api/v2.0.0/en/folktale.validation.validation.unsafeget-1.html b/docs/api/v2.0.0/en/folktale.validation.validation.unsafeget-1.html new file mode 100644 index 0000000..76d522f --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.validation.validation.unsafeget-1.html @@ -0,0 +1,60 @@ + + + + + unsafeGet + + + + + +

      unsafeGet

      Extracts the value from a Validation structure.

      +

      Signature

      forall a, b: (Validation a b).() => b :: throws TypeError

      Documentation

      Extracts the value from a Validation structure.

      +
      +

      WARNING
      This method is partial, which means that it will only work for Success +structures, not for Failure structures. It's recommended to use .getOrElse() +or .matchWith() instead.

      +
      +

      Example:

      +
      const { Failure, Success } = require('folktale/validation');
      +
      +Success('a').unsafeGet();
      +// ==> 'a'
      +
      +
      +try {
      +  Failure('a').unsafeGet();
      +  // TypeError: Can't extract the value of an Error
      +} catch (e) {
      +  e instanceof TypeError; // ==> true
      +}
      +

      Properties

      Source Code

      Defined in source/validation/validation.js at line 70, column 23
      {
      +    /*~*/
      +    Failure: function unsafeGet() {
      +      throw new TypeError(`Can't extract the value of a Failure.
      +
      +    Failure does not contain a normal value - it contains an error.
      +    You might consider switching from Validation#get to Validation#getOrElse, or some other method
      +    that is not partial.
      +      `);
      +    },
      +
      +    /*~*/
      +    Success: function unsafeGet() {
      +      return this.value;
      +    }
      +  }
      Licence
      MIT
      Module
      folktale/validation/validation
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.validation.validation.unsafeget.html b/docs/api/v2.0.0/en/folktale.validation.validation.unsafeget.html index f0d5734..76d522f 100644 --- a/docs/api/v2.0.0/en/folktale.validation.validation.unsafeget.html +++ b/docs/api/v2.0.0/en/folktale.validation.validation.unsafeget.html @@ -8,7 +8,7 @@

      unsafeGet

      Extracts the value from a Validation structure.

      Signature

      forall a, b: (Validation a b).() => b :: throws TypeError

      Documentation

      Extracts the value from a Validation structure.

      diff --git a/docs/api/v2.0.0/en/folktale.validation.validation.value-1.html b/docs/api/v2.0.0/en/folktale.validation.validation.value-1.html new file mode 100644 index 0000000..ed8f76a --- /dev/null +++ b/docs/api/v2.0.0/en/folktale.validation.validation.value-1.html @@ -0,0 +1,38 @@ + + + + + value + + + + + +

      value

      The value contained in an Success instance of the Validation structure.

      +

      Signature

      get value()
      forall a, b: get (Validation a b) => b

      Documentation

      The value contained in an Success instance of the Validation structure.

      +

      This is usually used to destructure the instance in a .matchWith call.

      +

      Example:

      +
      const Validation = require('folktale/validation');
      +
      +Validation.Success(1).matchWith({
      +  Success: ({ value }) => value,    // equivalent to (x) => x.value
      +  Failure: ({ value }) => 'nothing'
      +});
      +// ==> 1
      +

      Properties

      Source Code

      Defined in source/validation/validation.js at line 57, column 26
      get value() {
      +    throw new TypeError('`value` can’t be accessed in an abstract instance of Validation.Success');
      +  }
      Licence
      MIT
      Module
      folktale/validation/validation
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)
      + + + + \ No newline at end of file diff --git a/docs/api/v2.0.0/en/folktale.validation.validation.value.html b/docs/api/v2.0.0/en/folktale.validation.validation.value.html index 9819067..05e474a 100644 --- a/docs/api/v2.0.0/en/folktale.validation.validation.value.html +++ b/docs/api/v2.0.0/en/folktale.validation.validation.value.html @@ -8,21 +8,21 @@ -

      value

      The value contained in an Success instance of the Validation structure.

      -

      Signature

      get value()
      forall a, b: get (Validation a b) => b

      Documentation

      The value contained in an Success instance of the Validation structure.

      +

      value

      The value contained in an Failure instance of the Validation structure.

      +

      Signature

      get value()
      forall a, b: get (Validation a b) => a

      Documentation

      The value contained in an Failure instance of the Validation structure.

      This is usually used to destructure the instance in a .matchWith call.

      Example:

      const Validation = require('folktale/validation');
       
      -Validation.Success(1).matchWith({
      -  Success: ({ value }) => value,    // equivalent to (x) => x.value
      -  Failure: ({ value }) => 'nothing'
      +Validation.Failure(1).matchWith({
      +  Failure: ({ value }) => value,    // equivalent to (x) => x.value
      +  Success: ({ value }) => 'nothing'
       });
       // ==> 1
      -

      Properties

      Source Code

      Defined in source/validation/validation.js at line 57, column 26
      get value() {
      -    throw new TypeError('`value` can’t be accessed in an abstract instance of Validation.Success');
      +

      Properties

      Source Code

      Defined in source/validation/validation.js at line 45, column 26
      get value() {
      +    throw new TypeError('`value` can’t be accessed in an abstract instance of Validation.Failure');
         }
      Licence
      MIT
      Module
      folktale/validation/validation
      Authors
      Copyright
      (c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
      Authors
      • Quildreen Motta
      Maintainers
      • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)