Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Result Documentation #365

Merged
merged 31 commits into from
Apr 11, 2019
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c90b8be
Initial commit for Result documentation
dalefrancis88 Dec 7, 2018
897a946
More scaffolding work
dalefrancis88 Dec 12, 2018
0a5bd10
Updated signatures, added bi-map, updated either description
dalefrancis88 Dec 13, 2018
2f428f5
Updated Of and Equals with examples
dalefrancis88 Dec 14, 2018
794f351
Added concat, map and alt examples, updated descriptions
dalefrancis88 Dec 16, 2018
8d32d2a
Added in bimap and ap examples
dalefrancis88 Dec 17, 2018
62389c6
Adding examples for Chain
dalefrancis88 Dec 18, 2018
2309451
Minor re-work, added either example
dalefrancis88 Dec 19, 2018
be4e5ab
Updating and adding examples for Natural Transforms
dalefrancis88 Dec 20, 2018
da8a61d
Swap & Coalesce examples
dalefrancis88 Dec 21, 2018
721c25a
Added main examples, minor clean-up
dalefrancis88 Dec 21, 2018
bb6a20f
Updates
dalefrancis88 Dec 29, 2018
9fc4792
Adding traverse and sequence examples
dalefrancis88 Dec 29, 2018
e6fb496
Chain Update
dalefrancis88 Dec 30, 2018
b0441b8
Updated coalesce, added tryCatch description
dalefrancis88 Dec 31, 2018
9bb022b
Updated refrences on other pages, Updated structure and content of di…
dalefrancis88 Jan 1, 2019
9729f22
Merge branch 'master' into docs/Result
dalefrancis88 Jan 9, 2019
bed0f53
Minor changes per review comments
dalefrancis88 Jan 16, 2019
b0dcf14
Merge branch 'master' into docs/Result
evilsoft Jan 28, 2019
5daec7b
Updating main description
dalefrancis88 Feb 14, 2019
e2611f3
Some updates fro the review
dalefrancis88 Feb 25, 2019
c009a10
A few more minor updates
dalefrancis88 Feb 25, 2019
5cf15b7
Clean-up
dalefrancis88 Mar 3, 2019
11899e8
Update to `tryCatch`, added example code
dalefrancis88 Mar 3, 2019
98259cf
Merge branch 'master' into docs/Result
dalefrancis88 Mar 3, 2019
a462f0f
Alphabetizing imports
dalefrancis88 Mar 3, 2019
08d49ea
Updates per review comments
dalefrancis88 Mar 15, 2019
710d78c
Merge branch 'master' into docs/Result
evilsoft Mar 30, 2019
668960d
Merge branch 'master' into docs/Result
dalefrancis88 Apr 10, 2019
22cd651
Updates for the Review
dalefrancis88 Apr 10, 2019
915b1c9
Linting fix
dalefrancis88 Apr 10, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions docs/src/pages/docs/crocks/Async.md
Original file line number Diff line number Diff line change
Expand Up @@ -1711,17 +1711,17 @@ resultToAsync :: Result b a -> Async b a
resultToAsync :: (a -> Result c b) -> a -> Async c b
```

Used to transform a given `Result` instance to an `Async` instance or flatten an
`Async` of `Result` into an `Async` when chained, `resultToAsync` will turn an
Used to transform a given [`Result`][result] instance to an `Async` instance or flatten an
`Async` of [`Result`][result] into an `Async` when chained, `resultToAsync` will turn an
`Ok` instance into a [`Resolved`](#resolved) instance wrapping the original
value contained in the original `Ok`. If an `Err` is provided, then
`resultToAsync` will return a [`Rejected`](#rejected) instance, wrapping the
original `Err` value.

Like all `crocks` transformation functions, `resultToAsync` has two possible
signatures and will behave differently when passed either a `Result` instance
or a function that returns an instance of `Result`. When passed the instance,
a transformed `Async` is returned. When passed a `Result` returning function,
signatures and will behave differently when passed either a [`Result`][result] instance
or a function that returns an instance of [`Result`][result]. When passed the instance,
a transformed `Async` is returned. When passed a [`Result`][result] returning function,
a function will be returned that takes a given value and returns an `Async`.

<!-- eslint-disable no-console -->
Expand Down Expand Up @@ -1802,3 +1802,4 @@ Resolved(Ok('Success!'))
[either]: ./Either.html
[left]: ./Either.html#left
[right]: ./Either.html#right
[result]: ./Result.html
11 changes: 6 additions & 5 deletions docs/src/pages/docs/crocks/Either.md
Original file line number Diff line number Diff line change
Expand Up @@ -1283,16 +1283,16 @@ resultToEither :: Result e a -> Either e a
resultToEither :: (a -> Result e b) -> a -> Either e a
```

Used to transform a given `Result` instance to an `Either` instance or flatten
an `Either` of `Result` into an `Either` when chained, `resultToEither` will
Used to transform a given [`Result`][result] instance to an `Either` instance or flatten
an `Either` of [`Result`][result] into an `Either` when chained, `resultToEither` will
turn an `Ok` instance into a [`Right`](#right) instance wrapping the value
contained in the original `Ok`. If an `Err` is provided, then `resultToEither`
will return a [`Left`](#left) instance, wrapping the original `Err` value.

Like all `crocks` transformation functions, `resultToEither` has two possible
signatures and will behave differently when passed either a `Result` instance
or a function that returns an instance of `Result`. When passed the instance,
a transformed `Either` is returned. When passed a `Result` returning function,
signatures and will behave differently when passed either a [`Result`][result] instance
or a function that returns an instance of [`Result`][result]. When passed the instance,
a transformed `Either` is returned. When passed a [`Result`][result] returning function,
a function will be returned that takes a given value and returns an `Either`.

```javascript
Expand Down Expand Up @@ -1376,3 +1376,4 @@ Right(Ok('42'))
[maybe]: ./Maybe.html
[nothing]: ./Maybe.html#nothing
[just]: ./Maybe.html#just
[result]: ./Result.html
11 changes: 6 additions & 5 deletions docs/src/pages/docs/crocks/Maybe.md
Original file line number Diff line number Diff line change
Expand Up @@ -1530,18 +1530,18 @@ resultToMaybe :: Result e a -> Maybe a
resultToMaybe :: (a -> Result e b) -> a -> Maybe b
```

Used to transform a given `Result` instance to a `Maybe`
instance or flatten a `Maybe` of `Result` into a `Maybe` when chained,
Used to transform a given [`Result`][result] instance to a `Maybe`
instance or flatten a `Maybe` of [`Result`][result] into a `Maybe` when chained,
`resultToMaybe` will turn an `Ok` instance into a [`Just`](#just) wrapping the
original value contained in the `Ok`.
All `Err` instances will map to a [`Nothing`](#nothing), mapping the originally
contained value to a `Unit`. Values on the `Err` will be lost and as such this
transformation is considered lossy in that regard.

Like all `crocks` transformation functions, `resultToMaybe` has two possible
signatures and will behave differently when passed either an `Result` instance
or a function that returns an instance of `Result`. When passed the instance,
a transformed `Maybe` is returned. When passed a `Result` returning function,
signatures and will behave differently when passed either an [`Result`][result] instance
or a function that returns an instance of [`Result`][result]. When passed the instance,
a transformed `Maybe` is returned. When passed a [`Result`][result] returning function,
a function will be returned that takes a given value and returns a `Maybe`.

```javascript
Expand Down Expand Up @@ -1596,3 +1596,4 @@ Just(Err('to be human'))
[right]: ./Either.html#right
[first]: ../monoids/First.html
[last]: ../monoids/Last.html
[result]: ./Result.html
Loading