Skip to content

Commit

Permalink
More spelling and adjusting formatting as well
Browse files Browse the repository at this point in the history
  • Loading branch information
dalefrancis88 committed Jul 9, 2019
1 parent 91f4287 commit 66f1cb4
Show file tree
Hide file tree
Showing 23 changed files with 208 additions and 209 deletions.
30 changes: 15 additions & 15 deletions docs/src/pages/docs/crocks/Arrow.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ Arrow a b
```

`Arrow` is a `Profunctor` that lifts a function of type `a -> b` and allows for
lazy execution of the function. `Arrow` can be considered a `Strong Profunctor`
if the underlying data running through the `Arrow` is a `Pair`, typically in the
lazy execution of the function. `Arrow` can be considered a `Strong Profunctor` if
the underlying data running through the `Arrow` is a `Pair`, typically in the
form of `Arrow (Pair a c) (Pair b d)`.

This will allow you to split execution into two distinct paths, applying `Arrow`
to a specific path. The parameters of `Arrow` represent the function that it
wraps, with the input being on the left, and the output on the right. When an
`Arrow` wraps an endomorphism, the signature typically represents both the input
This will allow you to split execution into two distinct paths, applying `Arrow` to
a specific path. The parameters of `Arrow` represent the function that it
wraps, with the input being on the left, and the output on the right. When
an `Arrow` wraps an endomorphism, the signature typically represents both the input
and output.

```javascript
Expand Down Expand Up @@ -198,8 +198,8 @@ arrDoubleAndAdd
```haskell
Arrow a b ~> Arrow b c -> Arrow a c
```
`compose` allows you to compose two `Arrow`s together, resulting in a new
`Arrow` that is the result of the composition.
`compose` allows you to compose two `Arrow`s together, resulting in a
new `Arrow` that is the result of the composition.

```javascript
import Arrow from 'crocks/Arrow'
Expand Down Expand Up @@ -342,8 +342,8 @@ flow
Arrow a b ~> (b -> c) -> Arrow a c
```

`map` allows a function to be lifted that will map the right side of the
`Arrow`. Where [`contramap`](#contramap) is used to map the input, `map` maps the result
`map` allows a function to be lifted that will map the right side of the `Arrow`.
Where [`contramap`](#contramap) is used to map the input, `map` maps the result
of the `Arrow`, allowing the result to be "adapted" or modified. The input type
to the lifted function must match the result the `Arrow`.

Expand Down Expand Up @@ -384,11 +384,11 @@ arrStringFS
Arrow a b ~> ((c -> a), (b -> d)) -> Arrow c d
```

`promap` can be used to adapt BOTH ends of an `Arrow` allowing for existing
`Arrow`s to be reused in places in a flow where the types do not line up. It
combines both [`map`](#map) and [`contramap`](#contramap) into one operation.
Just pass the function for [`contramap`](#contramap) as the first argument
and the function [`map`](#map) as the second.
`promap` can be used to adapt BOTH ends of an `Arrow` allowing for existing `Arrow`s
to be reused in places in a flow where the types do not line up. It combines
both [`map`](#map) and [`contramap`](#contramap) into one operation. Just pass
the function for [`contramap`](#contramap) as the first argument and the
function [`map`](#map) as the second.

```javascript
import Arrow from 'crocks/Arrow'
Expand Down
22 changes: 11 additions & 11 deletions docs/src/pages/docs/crocks/Async.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ that can be composed together.

Depending on your needs, an `Async` can be constructed in a variety of ways. The
typical closely resembles how a `Promise` is constructed with one major
difference, the arguments used in the function that is passed to the `Promise`
constructor are reversed in an `Async` to match the order in which `Async` is
parameterized.
difference, the arguments used in the function that is passed to
the `Promise` constructor are reversed in an `Async` to match the order in
which `Async` is parameterized.

There are many ways to represent asynchronous operations in JavaScript, and as
such, the libraries available to us in our ecosystem provide different means
Expand Down Expand Up @@ -449,9 +449,9 @@ Async.all :: [ Async e a ] -> Async e [ a ]
```

`Async` provides an `all` method that can be used when multiple, independent
asynchronous operations need to be run in parallel. `all` takes an `Array` of
`Async` instances that, when forked, will execute each instance in the
provided `Array` in parallel.
asynchronous operations need to be run in parallel. `all` takes
an `Array` of `Async` instances that, when forked, will execute each instance
in the provided `Array` in parallel.

If any of the instances result in a [`Rejected`](#rejected) state, the entire flow will
be [`Rejected`](#rejected) with value of the first [`Rejected`](#rejected) instance. If all
Expand Down Expand Up @@ -1057,11 +1057,11 @@ typeIso(Rejected('aaaaa'))
Async e a ~> Async e a -> Async e a
```

Used to provide the first settled result between two `Async`s. Just pass `race`
another `Async` and it will return new `Async`, that when forked, will run both
`Async`s in parallel, returning the first of the two to settle. The result can
either be rejected or resolved, based on the instance of the first settled
result.
Used to provide the first settled result between two `Async`s. Just
pass `race` another `Async` and it will return new `Async`, that when forked,
will run both `Async`s in parallel, returning the first of the two to settle.
The result can either be rejected or resolved, based on the instance of the
first settled result.

<!-- eslint-disable no-console -->
<!-- eslint-disable no-sequences -->
Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/docs/crocks/Const.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ Const c a ~> (a -> b) -> Const c b

Typically used to lift a function into the context of an ADT, but due to the
unique behavior of `Const`, any function that is passed in to `map` will be
validated but it will not be applied. `map` will return a new `Const`
with the same left value.
validated but it will not be applied. `map` will return a new `Const` with
the same left value.

```javascript
import Const from 'crocks/Const'
Expand Down
16 changes: 8 additions & 8 deletions docs/src/pages/docs/crocks/Either.md
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,8 @@ fold([
Either c a ~> (a -> b) -> Either c b
```

Used to apply transformations to values [`Right`](#right) instances of `Either`, `map`
takes a function that it will lift into the context of the `Either` and apply to
Used to apply transformations to values [`Right`](#right) instances of `Either`, `map` takes
a function that it will lift into the context of the `Either` and apply to
it the wrapped value. When ran on a [`Right`](#right) instance, `map` will apply the
wrapped value to the provided function and return the result in a
new [`Right`](#right) instance.
Expand Down Expand Up @@ -1038,8 +1038,8 @@ firstToEither :: c -> (a -> First b) -> a -> Either c a
```

Used to transform a given [`First`][first] instance to an `Either` instance or
flatten an `Either` of [`First`][first] into an `Either` when chained, `firstToEither`
will turn a non-empty instance into a [`Right`](#right) wrapping the original
flatten an `Either` of [`First`][first] into an `Either` when chained, `firstToEither` will
turn a non-empty instance into a [`Right`](#right) wrapping the original
value contained within the [`First`][first].

The [`First`][first] datatype is based on a [`Maybe`][maybe] and as such its
Expand Down Expand Up @@ -1213,8 +1213,8 @@ maybeToEither :: c -> (a -> Maybe b) -> a -> Either c a
```

Used to transform a given [`Maybe`][maybe] instance to an `Either` instance or
flatten an `Either` of [`Maybe`][maybe] into an `Either` when chained, `maybeToEither`
will turn a [`Just`][just] instance into a [`Right`](#right) instance wrapping
flatten an `Either` of [`Maybe`][maybe] into an `Either` when chained, `maybeToEither` will
turn a [`Just`][just] instance into a [`Right`](#right) instance wrapping
the original value contained in the original [`Just`][just].

A [`Nothing`][nothing] instance is fixed to a `()` type and as such can only
Expand Down Expand Up @@ -1286,8 +1286,8 @@ resultToEither :: (a -> Result e b) -> a -> Either e a
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.
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`][result] instance
Expand Down
8 changes: 4 additions & 4 deletions docs/src/pages/docs/crocks/Equiv.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ The far right parameter of `Equiv` fixed to `Boolean` which means we cannot map
the value as expected. However the left two parameters can vary, although they
must vary in the same manner.

This is where `contramap` comes into play as it can be used to adapt an `Equiv`
of a given type to accept a different type or modify the value. Provide it a
This is where `contramap` comes into play as it can be used to adapt an `Equiv` of
a given type to accept a different type or modify the value. Provide it a
function that has a return type that matches the input types of the `Equiv`.
This will return a new `Equiv` matching the input type of the provided
function.
Expand Down Expand Up @@ -270,8 +270,8 @@ Equiv a a ~> () -> a -> a -> Boolean
`valueOf` is used on all `crocks` `Monoid`s as a means of extraction. While the
extraction is available, types that implement `valueOf` are not necessarily a
`Comonad`. This function is used primarily for convenience for some of the
helper functions that ship with `crocks`. Calling `valueOf` on an `Equiv`
instance will result in the underlying curried equivalence function.
helper functions that ship with `crocks`. Calling `valueOf` on
an `Equiv` instance will result in the underlying curried equivalence function.

```javascript
import Equiv from 'crocks/Equiv'
Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/docs/crocks/Identity.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ sumList([ 3, 4, 5 ])
Identity a ~> (a -> b) -> Identity b
```

Used to apply transformations to values you've lifted into an `Identity`, `map`
takes a function that it will lift into the context of the `Identity` and apply
Used to apply transformations to values you've lifted into an `Identity`, `map` takes
a function that it will lift into the context of the `Identity` and apply
to it the wrapped value. `Identity` contains no behavior and will do nothing
more than apply the value inside the `Identity` to the function.

Expand Down
86 changes: 43 additions & 43 deletions docs/src/pages/docs/crocks/Maybe.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ A `Maybe` represents disjunction by using two constructors, `Nothing` or `Just`.
A `Just` instance represents the truth case while `Nothing` is considered
false. With the exception of [`coalesce`](#coalesce), all `Maybe` returning
methods on an instance will be applied to a `Just` returning the result. If an
instance is a `Nothing`, then all application is skipped and another `Nothing`
is returned.
instance is a `Nothing`, then all application is skipped and another `Nothing` is
returned.

It is recommended to use the available [`Just`](#just) and [`Nothing`](#nothing)
constructors to construct `Maybe` instances in most cases. You can use the
`Maybe` constructor to construct a `Just`, but it may read better to just use
`Just`.
constructors to construct `Maybe` instances in most cases. You can use
the `Maybe` constructor to construct a `Just`, but it may read better to just
use `Just`.

```javascript
import Maybe from 'crocks/Maybe'
Expand Down Expand Up @@ -298,8 +298,8 @@ Maybe.zero :: () -> Maybe a

When working with `Alt`s, `zero` provides a sort of `empty` or identity for
`Maybe` when used with [`alt`](#alt). `zero` takes no arguments and returns a
`Nothing` instance. Just like an `empty` method on a given `Monoid`, `zero`
can be used to fold a collection of `Alt`s under `alt`.
`Nothing` instance. Just like an `empty` method on a given `Monoid`, `zero` can
be used to fold a collection of `Alt`s under `alt`.

```javascript
import Maybe from 'crocks/Maybe'
Expand Down Expand Up @@ -400,12 +400,12 @@ equals(Just([ 2, 3 ]), Just([ 2, 3 ]))
Semigroup s => Maybe s ~> Maybe s -> Maybe s
```

When an underlying value of a given `Maybe` is fixed to a `Semigroup`, `concat`
can be used to concat another `Maybe` instance with an underlying `Semigroup`
of the same type. Expecting a `Maybe` wrapping a `Semigroup` of the same type,
`concat` will give back a new `Maybe` instance wrapping the result of combining
the two underlying `Semigroup`s. When called on a `Nothing` instance, `concat`
will return a `Nothing`.
When an underlying value of a given `Maybe` is fixed to a `Semigroup`, `concat` can
be used to concat another `Maybe` instance with an underlying `Semigroup` of
the same type. Expecting a `Maybe` wrapping a `Semigroup` of the same
type, `concat` will give back a new `Maybe` instance wrapping the result of combining
the two underlying `Semigroup`s. When called on a `Nothing` instance, `concat` will
return a `Nothing`.

```javascript
import Maybe from 'crocks/Maybe'
Expand Down Expand Up @@ -525,11 +525,10 @@ setProcessed(null)
Maybe a ~> Maybe a -> Maybe a
```

Providing a means for a fallback or alternative value, `alt` combines two
`Maybe` instances and will return the first `Just` it encounters or `Nothing`
if it does not have a `Just`. This can be used in conjunction with
[`zero`](#zero) to return the first valid value in contained in a `Foldable`
structure.
Providing a means for a fallback or alternative value, `alt` combines
two `Maybe` instances and will return the first `Just` it encounters or `Nothing` if
it does not have a `Just`. This can be used in conjunction with [`zero`](#zero) to
return the first valid value in contained in a `Foldable` structure.

```javascript
import Maybe from 'crocks/Maybe'
Expand Down Expand Up @@ -569,9 +568,10 @@ Maybe (a -> b) ~> Maybe a -> Maybe b
```

Short for apply, `ap` is used to apply a `Maybe` instance containing a value
to another `Maybe` instance that contains a function, resulting in new `Maybe`
instance with the result. `ap` requires that it is called on an `instance` that
is either a `Nothing` or a `Just` that wraps a curried polyadic function.
to another `Maybe` instance that contains a function, resulting in
new `Maybe` instance with the result. `ap` requires that it is called on
an `instance` that is either a `Nothing` or a `Just` that wraps a curried
polyadic function.

When either `Maybe` is a `Nothing`, `ap` will return a `Nothing`. This can be
used to safely combine multiple values under a given combination function. If
Expand Down Expand Up @@ -805,9 +805,9 @@ When one would like to [`option`](#option) a `Maybe` but would like to remain
within a `Maybe` type, `coalesce` can be used. `coalesce` expects two functions
for its inputs.

The first function is used when invoked on a `Nothing` and will return a `Just`
instance wrapping the result of the function. The second function is used when
`coalesce` is invoked on a `Just` and is used to map the original value,
The first function is used when invoked on a `Nothing` and will return
a `Just` instance wrapping the result of the function. The second function is
used when `coalesce` is invoked on a `Just` and is used to map the original value,
returning a new `Just` instance wrapping the result of the second function.

```javascript
Expand Down Expand Up @@ -960,11 +960,11 @@ toArray(Nothing())
find :: Foldable f => ((a -> Boolean) | Pred) -> f a -> Maybe a
```

Using a provided predicate function or a `Pred` datatype, `find` takes a
`Foldable` instance and executes for every value in the `Foldable`, skipping
Using a provided predicate function or a `Pred` datatype, `find` takes
a `Foldable` instance and executes for every value in the `Foldable`, skipping
empty indexes. `find` then returns the first value it finds that passes the
predicate. If found, `find` returns the value in a `Just`, otherwise a `Nothing`
is returned.
predicate. If found, `find` returns the value in a `Just`, otherwise
a `Nothing` is returned.

```javascript
import find from 'crocks/Maybe/find'
Expand Down Expand Up @@ -1057,8 +1057,8 @@ getStringFirst({ value: [ 'nice', 'jobb' ] })
getProp :: (String | Integer) -> a -> Maybe b
```

If you want some safety around pulling a value out of an `Object` or `Array`
with a single key or index, you can always reach for `getProp`, previously known
If you want some safety around pulling a value out of an `Object` or `Array` with
a single key or index, you can always reach for `getProp`, previously known
as `prop`. Well, as long as you are working with non-nested data that is. Just
tell `getProp` either the key or index you are interested in, and you will get
back a function that will take anything and return a `Just` with the wrapped
Expand Down Expand Up @@ -1333,10 +1333,10 @@ eitherToMaybe :: Either b a -> Maybe a
eitherToMaybe :: (a -> Either c b) -> a -> Maybe b
```

Used to transform a given [`Either`][either] instance to a `Maybe`
instance or flatten a `Maybe` of `Either` into a `Maybe` when chained,
`eitherToMaybe` will turn a [`Right`][right] instance into
a [`Just`](#just) wrapping the original value contained in the [`Right`][right].
Used to transform a given [`Either`][either] instance to a `Maybe` instance
or flatten a `Maybe` of `Either` into a `Maybe` when chained, `eitherToMaybe` will
turn a [`Right`][right] instance into a [`Just`](#just) wrapping the original
value contained in the [`Right`][right].
All [`Left`][left] instances will map to a [`Nothing`](#nothing), mapping the
originally contained value to a `Unit`. Values on the [`Left`][left] will be
lost and as such this transformation is considered lossy in that regard.
Expand Down Expand Up @@ -1406,11 +1406,11 @@ firstToMaybe :: First a -> Maybe a
firstToMaybe :: (a -> First b) -> a -> Maybe b
```

Used to transform a given [`First`][first] instance to a `Maybe`
instance or flatten a `Maybe` of `First` into a `Maybe` when chained,
`firstToMaybe` will turn a non-empty instance into a [`Just`](#just) wrapping
the original value contained within the [`First`][first]. All empty instances
will map to a [`Nothing`](#nothing).
Used to transform a given [`First`][first] instance to a `Maybe` instance or
flatten a `Maybe` of `First` into a `Maybe` when chained, `firstToMaybe` will
turn a non-empty instance into a [`Just`](#just) wrapping the original value
contained within the [`First`][first]. All empty instances will map to
a [`Nothing`](#nothing).

Like all `crocks` transformation functions, `firstToMaybe` has two possible
signatures and will behave differently when passed either
Expand Down Expand Up @@ -1608,10 +1608,10 @@ resultToMaybe :: Result e a -> Maybe a
resultToMaybe :: (a -> Result e b) -> a -> Maybe b
```

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`.
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.
Expand Down

0 comments on commit 66f1cb4

Please sign in to comment.