Skip to content

Commit

Permalink
Merge 66f1cb4 into f073ee8
Browse files Browse the repository at this point in the history
  • Loading branch information
dalefrancis88 committed Jul 9, 2019
2 parents f073ee8 + 66f1cb4 commit 74671ec
Show file tree
Hide file tree
Showing 26 changed files with 220 additions and 221 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ Thanks goes to these wonderful people ([emoji key][emojis]):
### Course/Videos

#### Video evilsoft
* [State Monad In Javascript (egghead.io)](https://egghead.io/courses/state-monad-in-javascript)
* [State Monad In JavaScript (egghead.io)](https://egghead.io/courses/state-monad-in-javascript)
* [Working With ADTs (YouTube)](https://www.youtube.com/playlist?list=PLjvgv-FpMo7XRVFZjZsWXJ5nVmRJ5a5Hv)
* [Functional JS (YouTube)](https://www.youtube.com/playlist?list=PLjvgv-FpMo7XvlfO8YKiz4_onf8WonhiA)

Expand Down
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
24 changes: 12 additions & 12 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 Expand Up @@ -1279,7 +1279,7 @@ import Async from 'crocks/Async'
import race from 'crocks/Async/race'
import asyncToPromise from 'crocks/Async/asyncToPromise'

import ifElse from 'crocks/logice/ifElse'
import ifElse from 'crocks/logic/ifElse'
import compose from 'crocks/helpers/compose'
import isPromise from 'crocks/pointfree/isPromise'

Expand Down
6 changes: 3 additions & 3 deletions docs/src/pages/docs/crocks/Const.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const add =

Pair(Identity(30), StrConst('always, forever'))
.bimap(map(add(4)), map(add(4)))
//=> Pair(Identity 34, Const(String) "alway, forever")
//=> Pair(Identity 34, Const(String) "always, forever")

// ArrayConst :: [ b ] -> Const [ b ] a
const ArrayConst =
Expand Down 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
8 changes: 4 additions & 4 deletions docs/src/pages/docs/crocks/Identity.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Identity a
```

`Identity` is a `crock` that can be used to wrap a common interface around
existing Javascript types and functions. It maintains integrity by lifting
existing JavaScript types and functions. It maintains integrity by lifting
and applying functions and types as is, without adding any additional structure
or effects. By not applying and additional structure to existing functions,
`Identity` can be swapped in and out for other `Functor`s that do apply their
Expand All @@ -37,7 +37,7 @@ Identity(10)
Identity :: a -> Identity a
```

The contstructor for an `Identity` is a unary function. When a value is passed
The constructor for an `Identity` is a unary function. When a value is passed
in an `Identity` of the given value is returned ready for `map` or `chain`.

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

0 comments on commit 74671ec

Please sign in to comment.