-
Notifications
You must be signed in to change notification settings - Fork 102
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
Add READMEs for All, Any and Arrow types #148
Conversation
1 similar comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not like these docs.
The examples are overly complicated and the focus is lost for almost all of them on Arrow
Dial back and only show maybe some law validation (without mentioning it, just to show what is expected for a given algebra on a given type.
src/All/README.md
Outdated
`concat` is used to combine (2) `Semigroup`s of the same type under an operation specified by the `Semigroup`. In the case of `All`, it will combine the two using logical AND (conjunction). | ||
|
||
```js | ||
All(true).concat(All(true)) //=> All false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should result to All true
src/All/README.md
Outdated
All(false).concat(All(false)) //=> All false | ||
``` | ||
|
||
### value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might as well name these to valueOf
due to: this PR
src/Any/README.md
Outdated
|
||
`empty` provides the identity for the `Monoid` in that when the value it provides is `concat`ed to any other value, it will return the other value. In the case of `Any` the result of `empty` is `false`. `empty` is available on both the Constructor and the Instance for convenience. | ||
```js | ||
Any.empty() //=> Any true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be Any false
src/Any/README.md
Outdated
isSameType(Any, Any) //=> true | ||
isSameType(Any(false), Assign) //=> false | ||
|
||
//=> false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move under
src/Any/README.md
Outdated
Any(false).concat(Any(false)) //=> Any false | ||
``` | ||
|
||
### value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might as well name these to valueOf
due to: this PR
src/Arrow/README.md
Outdated
.runWith({ value: '23' }) //=> 10 | ||
|
||
arrAdd10Value | ||
.runWith({ num: '23' }) //=> 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move under
src/Arrow/README.md
Outdated
Arrow(x => x.toUpperCase()) | ||
|
||
arrToUpper | ||
.runWith('burrito bounce') //=> 'BURRITO BOUNCE' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move under
src/Arrow/README.md
Outdated
Arrow a b ~> ((c -> a), (b -> d)) -> Arrow c d | ||
``` | ||
|
||
`promap` can be used to adapt BOTH ends of an `Arrow` allow for existing `Arrow`s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allowing for existing Arrow
s
src/Arrow/README.md
Outdated
``` | ||
|
||
`promap` can be used to adapt BOTH ends of an `Arrow` allow for existing `Arrow`s | ||
to be reused in places in a flow where the types so not line up. It combines both |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not line up
src/Arrow/README.md
Outdated
const arrDoubleAndAdd = | ||
arrDouble | ||
.both() | ||
.map(merge((x, y) => x + y)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use the add
function here.
Seems like an OKAY start
These are the first in a series of Readmes to be added. This is another step in the Quest for monorepo.
Both
All
andAny
did not require any API changes, while there was no need to keepvalue
forArrow
as it no longer is used as a "traditional"Monoid
as it was beforeCategory
was a thing.This is a BREAKING API change. No depreciation, just dropping it.