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

Documentation #24

Merged
34 commits merged into from
May 19, 2016
Merged

Documentation #24

34 commits merged into from
May 19, 2016

Conversation

ghost
Copy link

@ghost ghost commented May 16, 2016

@raulraja take a look and let me know your suggestions please.

mixing low-level (optimization) and high-level (business logic with the data
we read) concerns.

Fetch is a library that allows your data fetches to be written in a concise,
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be the first paragraph

@ghost
Copy link
Author

ghost commented May 17, 2016

@raulraja i've changed many examples to use Id instead of Future, I'm going to do so with the homepage to simplify it. Let me know what you think!


We are now ready to declare and run fetches. We need to provide Fetch with a target
monad when we want to execute a fetch. We'll be using `Id` for now, make sure to import
`fetch.implicits._` since Fetch needs an instance of `MonadError[Id, Throwable]` for running
Copy link
Contributor

Choose a reason for hiding this comment

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

Also for any other Monads. We should state right here that Fetch comes with builtin impls of MonadError for Id, Task, Future, etc...

Copy link
Author

Choose a reason for hiding this comment

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

Added it just below this paragraph.


## Implementing a custom cache

The default cache is implemented as an in-memory map, but users are free to use their own caches when running a fetch. Your cache should implement the `DataSourceCache` trait, and after that you can pass it to Fetch's `run` methods.
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps worth mentioning here that the cache is trampolined inside a state monad when evaluating a Fetch so people understand they can easily implement caches with inmutable data structures and not mutable maps.


## cats

Fetch is built using cats' Free monad construction and thus works out of the box with
Copy link
Contributor

Choose a reason for hiding this comment

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

Mention to tree optimization?

Copy link
Author

Choose a reason for hiding this comment

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

Done!

@raulraja
Copy link
Contributor

Some small comments, once addressed this LGTM and it's ready for lang review. Awesome work!

@ghost
Copy link
Author

ghost commented May 17, 2016

All your comments addressed, feel free to merge @raulraja

@raulraja
Copy link
Contributor

Great work @dialelo.
@MaureenElsberry This is ready for lang review. Can you take a quick pass? thanks!

@ghost ghost merged commit 24470bc into master May 19, 2016
@ghost ghost deleted the docs branch May 19, 2016 09:37
This pull request was closed.
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.

None yet

2 participants