Skip to content

Commit

Permalink
Fixes links to the APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
robotlolita committed Dec 30, 2017
1 parent 2c97237 commit 54b8596
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion docs/_docs/v2.1.0/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ We've also got some pages on [how to get help]({% link _docs/support/index.md %}
</div>

<div class="box">
<div class="box-title"><a href="/api/v2.0.0/en/folktale.html">API reference</a></div>
<div class="box-title"><a href="/api/v2.1.0/en/folktale.html">API reference</a></div>
<p>Describes all functions and objects, with motivating use cases and usage examples.</p>
</div>

Expand Down
6 changes: 3 additions & 3 deletions docs/_docs/v2.1.0/migrating/from-core.lambda.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ prev_doc: v2.0.0/migrating/from-core.arity
next_doc: v2.0.0/migrating/from-data.either
---

`Core.Lambda` provided basic operations to combine and transform functions. Most of the important ones are still available in Folktale 2, but under a different module. This page provides migration instructions for each function in `Core.Lambda`. You can look at the [full documentation for `core/lambda`](/api/v2.0.0/en/folktale.core.lambda.html) for more detailed information.
`Core.Lambda` provided basic operations to combine and transform functions. Most of the important ones are still available in Folktale 2, but under a different module. This page provides migration instructions for each function in `Core.Lambda`. You can look at the [full documentation for `core/lambda`](/api/v2.1.0/en/folktale.core.lambda.html) for more detailed information.


## Contents
Expand Down Expand Up @@ -108,7 +108,7 @@ const { unary } = require('core.arity');

## compose(f, g)(x)

Folktale 2 provides a `compose` function without the unrolling semantics. See [the `compose` documentation](/api/v2.0.0/en/folktale.core.lambda.compose.compose.html) for details.
Folktale 2 provides a `compose` function without the unrolling semantics. See [the `compose` documentation](/api/v2.1.0/en/folktale.core.lambda.compose.compose.html) for details.

If you're using `compose` in the form `compose(f, g)(x)`, then you only need to change your imports:

Expand Down Expand Up @@ -181,7 +181,7 @@ thenDouble(inc)(3);

## curry(arity, f) {#curry}

Folktale 2 provides a `curry` function that's very similar to the old one, with the difference that it'll only unroll up to the provided arity. This avoids problems with Folktale trying to unroll application of non-curried function when interacting with variadic functions in JavaScript (for example, with `Array#map`). See [the `curry` documentation](/api/v2.0.0/en/folktale.core.lambda.curry.curry.html) for details.
Folktale 2 provides a `curry` function that's very similar to the old one, with the difference that it'll only unroll up to the provided arity. This avoids problems with Folktale trying to unroll application of non-curried function when interacting with variadic functions in JavaScript (for example, with `Array#map`). See [the `curry` documentation](/api/v2.1.0/en/folktale.core.lambda.curry.curry.html) for details.

The only thing you need to do is changing your imports.

Expand Down
6 changes: 3 additions & 3 deletions docs/_docs/v2.1.0/migrating/from-data.either.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ prev_doc: v2.0.0/migrating/from-core.lambda
next_doc: v2.0.0/migrating/from-data.maybe
---

`Data.Either` provided a disjunction to model the result of functions that could fail. Folktale 2 has changed a few things around and this data structure is now called `Result`, with `Ok` and `Error` as its variant tags. This page explains how to migrate from the old `Data.Either` to the new `Result` object. You can look at the [full documentation for Result](/api/v2.0.0/en/folktale.result.html) for more detailed information.
`Data.Either` provided a disjunction to model the result of functions that could fail. Folktale 2 has changed a few things around and this data structure is now called `Result`, with `Ok` and `Error` as its variant tags. This page explains how to migrate from the old `Data.Either` to the new `Result` object. You can look at the [full documentation for Result](/api/v2.1.0/en/folktale.result.html) for more detailed information.


## Contents
Expand Down Expand Up @@ -150,7 +150,7 @@ safeDivide(4, 0); // ==> Result.Error([Error: division by zero])

The new `applicativeFn.apply(applicativeValue)` method is the recommended way of using applicative functors now, which is standardised across Folktale and independent of Fantasy-Land changes.

`.apply` and `.ap` still have the same semantics, but those semantics are different from the new `fantasy-land/ap` function! In order to write functions that are generic over different Fantasy-Land implementations and versions, the new [fantasy-land](/api/v2.0.0/en/folktale.fantasy-land.html) module should be used instead.
`.apply` and `.ap` still have the same semantics, but those semantics are different from the new `fantasy-land/ap` function! In order to write functions that are generic over different Fantasy-Land implementations and versions, the new [fantasy-land](/api/v2.1.0/en/folktale.fantasy-land.html) module should be used instead.


## Equality testing
Expand Down Expand Up @@ -179,7 +179,7 @@ Result.Ok([1]).equals(Result.Ok([1]));
// ==> true
{% endhighlight %}

More details can be found on the [Equality derivation](/api/v2.0.0/en/folktale.adt.union.derivations.equality.equality.html) documentation.
More details can be found on the [Equality derivation](/api/v2.1.0/en/folktale.adt.union.derivations.equality.equality.html) documentation.


## Either.get
Expand Down
8 changes: 4 additions & 4 deletions docs/_docs/v2.1.0/migrating/from-data.maybe.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ prev_doc: v2.0.0/migrating/from-data.either
next_doc: v2.0.0/migrating/from-data.task
---

`Data.Maybe` provided a way of modelling computations that may provide a value or not. Folktale 2 keeps the same structure, but there're some changes in how you extract values out of Maybes and test them. You can look at the [full documentation for Maybe](/api/v2.0.0/en/folktale.maybe.html) for more detailed information.
`Data.Maybe` provided a way of modelling computations that may provide a value or not. Folktale 2 keeps the same structure, but there're some changes in how you extract values out of Maybes and test them. You can look at the [full documentation for Maybe](/api/v2.1.0/en/folktale.maybe.html) for more detailed information.


## Contents
Expand Down Expand Up @@ -110,7 +110,7 @@ Maybe.hasInstance(null); // ==> false

The new `applicativeFn.apply(applicativeValue)` method is the recommended way of using applicative functors now, which is standardised across Folktale and independent of Fantasy-Land changes.

`.apply` and `.ap` still have the same semantics, but those semantics are different from the new `fantasy-land/ap` function! In order to write functions that are generic over different Fantasy-Land implementations and versions, the new [fantasy-land](/api/v2.0.0/en/folktale.fantasy-land.html) module should be used instead.
`.apply` and `.ap` still have the same semantics, but those semantics are different from the new `fantasy-land/ap` function! In order to write functions that are generic over different Fantasy-Land implementations and versions, the new [fantasy-land](/api/v2.1.0/en/folktale.fantasy-land.html) module should be used instead.


## Equality testing
Expand Down Expand Up @@ -139,7 +139,7 @@ Maybe.Just([1]).equals(Maybe.Just([1]));
// ==> true
{% endhighlight %}

More details can be found on the [Equality derivation](/api/v2.0.0/en/folktale.adt.union.derivations.equality.equality.html) documentation.
More details can be found on the [Equality derivation](/api/v2.1.0/en/folktale.adt.union.derivations.equality.equality.html) documentation.


## Maybe.get
Expand Down Expand Up @@ -200,4 +200,4 @@ Maybe.Just(1).toJSON();
Maybe.fromJSON(Maybe.Just(1).toJSON());
{% endhighlight %}

More details can be found on the [Serialization derivation](/api/v2.0.0/en/folktale.adt.union.derivations.serialization.serialization.html) documentation.
More details can be found on the [Serialization derivation](/api/v2.1.0/en/folktale.adt.union.derivations.serialization.serialization.html) documentation.
4 changes: 2 additions & 2 deletions docs/_docs/v2.1.0/migrating/from-data.task.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ prev_doc: v2.0.0/migrating/from-data.maybe
next_doc: v2.0.0/migrating/from-data.validation
---

The `Task` structure went through many changes in Folktale 2 to make automatic resource management of asynchronous computations safer and more robust. It also removes the need for the external `control.async` module, by natively supporting combining tasks in the object itself. This page explains how to migrate from the old `Data.Task` to the new `Task` module. You can look at the [full documentation for the concurrency module](/api/v2.0.0/en/folktale.concurrency.html) for more detailed information.
The `Task` structure went through many changes in Folktale 2 to make automatic resource management of asynchronous computations safer and more robust. It also removes the need for the external `control.async` module, by natively supporting combining tasks in the object itself. This page explains how to migrate from the old `Data.Task` to the new `Task` module. You can look at the [full documentation for the concurrency module](/api/v2.1.0/en/folktale.concurrency.html) for more detailed information.


## Contents
Expand Down Expand Up @@ -170,7 +170,7 @@ While the previous Task had an applicative functor that ran tasks in parallel, t

The new `applicativeFn.apply(applicativeValue)` method is the recommended way of using applicative functors now, which is standardised across Folktale and independent of Fantasy-Land changes.

`.apply` and `.ap` have the same semantics, but those semantics are different from the new `fantasy-land/ap` function! In order to write functions that are generic over different Fantasy-Land implementations and versions, the new [fantasy-land](/api/v2.0.0/en/folktale.fantasy-land.html) module should be used instead.
`.apply` and `.ap` have the same semantics, but those semantics are different from the new `fantasy-land/ap` function! In order to write functions that are generic over different Fantasy-Land implementations and versions, the new [fantasy-land](/api/v2.1.0/en/folktale.fantasy-land.html) module should be used instead.


## Task.concat
Expand Down
6 changes: 3 additions & 3 deletions docs/_docs/v2.1.0/migrating/from-data.validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ prev_doc: v2.0.0/migrating/from-data.task
next_doc: v2.0.0/migrating/from-early-v2.0.0
---

`Data.Validation` provided a way of modelling composable validations. Folktale 2 keeps the same structure and semantics, but there's some changes in how you extract values out of Validations and test them. You can look at the [full documentation for Validation](/api/v2.0.0/en/folktale.validation.html) for more detailed information.
`Data.Validation` provided a way of modelling composable validations. Folktale 2 keeps the same structure and semantics, but there's some changes in how you extract values out of Validations and test them. You can look at the [full documentation for Validation](/api/v2.1.0/en/folktale.validation.html) for more detailed information.


## Contents
Expand Down Expand Up @@ -89,7 +89,7 @@ Folktale 2 replaces these with a `.hasInstance(value)` function on the variant c

The new `applicativeFn.apply(applicativeValue)` method is the recommended way of using applicative functors now, which is standardised across Folktale and independent of Fantasy-Land changes.

`.apply` and `.ap` still have the same semantics, but those semantics are different from the new `fantasy-land/ap` function! In order to write functions that are generic over different Fantasy-Land implementations and versions, the new [fantasy-land](/api/v2.0.0/en/folktale.fantasy-land.html) module should be used instead.
`.apply` and `.ap` still have the same semantics, but those semantics are different from the new `fantasy-land/ap` function! In order to write functions that are generic over different Fantasy-Land implementations and versions, the new [fantasy-land](/api/v2.1.0/en/folktale.fantasy-land.html) module should be used instead.


## Equality testing
Expand Down Expand Up @@ -120,7 +120,7 @@ Validation.Success([1]).equals(Validation.Success([1]));
{% endhighlight %}


More details can be found on the [Equality derivation](/api/v2.0.0/en/folktale.adt.union.derivations.equality.equality.html) documentation.
More details can be found on the [Equality derivation](/api/v2.1.0/en/folktale.adt.union.derivations.equality.equality.html) documentation.


## Validation.get
Expand Down
20 changes: 10 additions & 10 deletions docs/_docs/v2.1.0/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ next_doc: v2.0.0/changelog
---

Folktale is a library to support a functional style of programming in JavaScript.
In its current version Folktale provides utilities for [combining functions](/api/v2.0.0/en/folktale.core.lambda.html),
[transforming objects](/api/v2.0.0/en/folktale.core.object.html), [modelling data](/api/v2.0.0/en/folktale.adt.html), [handling errors](/api/v2.0.0/en/folktale.html#cat-handling-failures), and [concurrency](/api/v2.0.0/en/folktale.concurrency.task.html).
In its current version Folktale provides utilities for [combining functions](/api/v2.1.0/en/folktale.core.lambda.html),
[transforming objects](/api/v2.1.0/en/folktale.core.object.html), [modelling data](/api/v2.1.0/en/folktale.adt.html), [handling errors](/api/v2.1.0/en/folktale.html#cat-handling-failures), and [concurrency](/api/v2.1.0/en/folktale.concurrency.task.html).

The [API reference](/api/v2.0.0/en/folktale.html) provides detailed documentation
The [API reference](/api/v2.1.0/en/folktale.html) provides detailed documentation
on these, but may be difficult to navigate. This page serves as an introduction to
the most important concepts.

Expand Down Expand Up @@ -73,7 +73,7 @@ const value = counter.next();
// ==> [4, 4, 4]
{% endhighlight %}

Another option is using a functional combinator like [constant](/api/v2.0.0/en/folktale.core.lambda.constant.constant.html):
Another option is using a functional combinator like [constant](/api/v2.1.0/en/folktale.core.lambda.constant.constant.html):

{% highlight js %}
const constant = require('folktale/core/lambda/constant');
Expand All @@ -82,7 +82,7 @@ const constant = require('folktale/core/lambda/constant');
// ==> [5, 5, 5]
{% endhighlight %}

Folktale's [`core/lambda`](/api/v2.0.0/en/folktale.core.lambda.html) module tries to provide
Folktale's [`core/lambda`](/api/v2.1.0/en/folktale.core.lambda.html) module tries to provide
these small utilities that help combining and transforming functions in a program. See the
module's documentation for more details.

Expand All @@ -94,7 +94,7 @@ boil down mostly to control-flow structures (`if/else`) or exceptions (`try/catc
tend to either be hard to predict or hard to maintain. Folktale provides three data
structures to help with error handling:

- [Maybe](/api/v2.0.0/en/folktale.maybe.html) - A structure that helps handling values
- [Maybe](/api/v2.1.0/en/folktale.maybe.html) - A structure that helps handling values
that may or may not be present. For example, a function like `Array.find` may or may
not be able to return a value. People tend to use `null` as a return value when the
function fails to return one, but that's ambiguous if the original array had a `null`
Expand All @@ -116,7 +116,7 @@ structures to help with error handling:
find([null, 1], x => false); // ==> Maybe.Nothing()
{% endhighlight %}

- [Result](/api/v2.0.0/en/folktale.result.html) - A structure that models the result
- [Result](/api/v2.1.0/en/folktale.result.html) - A structure that models the result
of functions that may fail. For example, parsing a JSON string into native objects
doesn't always succeed, but it may fail for different reasons: the JSON string could
be malformed, the reifying function could throw an error, etc. Ideally we'd capture
Expand Down Expand Up @@ -148,7 +148,7 @@ structures to help with error handling:
divide(2, 0); // ==> Result.Error([DivisionByZero: 2 / 0 is not computable])
{% endhighlight %}

- [Validation](/api/v2.0.0/en/folktale.validation.html) - A structure that helps with
- [Validation](/api/v2.1.0/en/folktale.validation.html) - A structure that helps with
validations (such as form validations). A validation function may succeed or fail,
like the functions mentioned above, but unlike the cases where Result is indicated,
when doing validations one generally wants to capture *all* of the failures and
Expand Down Expand Up @@ -213,7 +213,7 @@ Branch(
{% endhighlight %}


More documentation can be found in the [`adt/union`](/api/v2.0.0/en/folktale.adt.union.html)
More documentation can be found in the [`adt/union`](/api/v2.1.0/en/folktale.adt.union.html)
module reference.


Expand All @@ -230,5 +230,5 @@ and cancellation. This means that, if a Task is cancelled before it finishes exe
resources it allocated will be properly disposed of. Even when combined with other tasks,
or transformed by other functions.

The documentation for the [`concurrency/task`](/api/v2.0.0/en/folktale.concurrency.task.html)
The documentation for the [`concurrency/task`](/api/v2.1.0/en/folktale.concurrency.task.html)
module describes this in details.

0 comments on commit 54b8596

Please sign in to comment.