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

Revamp Functor, Applicative, Traverse doc #1513

Merged
merged 1 commit into from
Jan 14, 2017

Conversation

adelbertc
Copy link
Contributor

No description provided.

@adelbertc adelbertc mentioned this pull request Jan 4, 2017
18 tasks
@codecov-io
Copy link

codecov-io commented Jan 4, 2017

Current coverage is 92.26% (diff: 100%)

Merging #1513 into master will decrease coverage by 0.10%

@@             master      #1513   diff @@
==========================================
  Files           246        246          
  Lines          3763       3763          
  Methods        3638       3637     -1   
  Messages          0          0          
  Branches        125        126     +1   
==========================================
- Hits           3476       3472     -4   
- Misses          287        291     +4   
  Partials          0          0          

Powered by Codecov. Last update 2e621b8...636d6df

* Left identity: Zipping a value on the left with unit results in something ismorphic to the original value
* `pure(()).product(fa) ~ fa`
* As an equality: `pure(()).product(fa).map(_._2) = fa`
* Right identity: Zipping a value on the right with unit results in something ismorphic to the original value
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/ismorphic/isomorphic, same 3 lines up

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

List(1,2,3).map(_ + 1)
Vector(1,2,3).map(_.toString)
```
* Composition: Mapping with `f` and then again with `f` is the same as mapping once with the composition of `f` and `g`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops there should be "then again with g" here


## Using Functor
## Functors compose
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now this section looks like this

Functors Compose

we can compose either with compose or with nested
compose example
nested example
compose notes
nested notes

how about this instead?

Functors Compose

we can compose either with compose or with nested

compose

compose example
compose notes

nested

nested example
nested notes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, will do

At no point do we manually pass in or thread a `SparkContext` through - that is taken care for us
by the (applicative) effect of `Reader` and therefore by `traverse`.

## Sequencing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the Traverse tutorial starts with Future.sequence, is it still worth mentioning the sequence method in Traverse?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do


### Playing with `Reader`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found this section is another good example of Reader, how about we move it the kleisli.md instead of losing it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm how about I go back to this when I (or someone else) gets around to revisiting the Reader tut? I don't want to just tack on this section at the end since one of the reasons I'm revisiting these docs is to try to make them more cohesive.

Copy link
Contributor

@kailuowang kailuowang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really nice. Thanks! 👍

@tpolecat
Copy link
Member

This looks great to me. 👍

@adelbertc
Copy link
Contributor Author

Thanks for the review all! Merging now.

@adelbertc adelbertc merged commit 9209bbe into typelevel:master Jan 14, 2017
@stew stew removed the in progress label Jan 14, 2017
Leammas added a commit to Leammas/cats that referenced this pull request Jan 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants