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

add recipe introducing servant-pagination #946

Merged
merged 1 commit into from Apr 17, 2018

Conversation

Projects
None yet
2 participants
@KtorZ
Copy link
Contributor

commented Apr 16, 2018

As proposed in #125, here's a short introduction to servant-pagination.

Feedback is welcome :)

@alpmestan

This comment has been minimized.

Copy link
Contributor

commented Apr 16, 2018

@KtorZ Haven't yet looked at the explanations (I won't be too picky though, don't worry), but is there a reason why your patch comes with both a Main.hs and a Pagination.lhs, with the code duplicated in both?

See 5ac6de8 for an example of commit that adds a cookbook recipe with the code and explanations in a single file. The trick is to have:

  ghc-options:         -pgmL markdown-unlit
  build-tool-depends: markdown-unlit:markdown-unlit

in the .cabal file. This processes the file with markdown-unlit (which strips away all the markdown, only leaving the code) before giving its contents to GHC.

@KtorZ

This comment has been minimized.

Copy link
Contributor Author

commented Apr 16, 2018

Ah! You're entirely right, I wrongly committed that. I'll update 👍

@KtorZ

This comment has been minimized.

Copy link
Contributor Author

commented Apr 17, 2018

Done 👍
Let me know :)

@alpmestan
Copy link
Contributor

left a comment

Looks great, thank you for taking the time to write it all down!

#### Parsing Options
By default, `servant-pagination` provides an implementation of `getRangeOptions` for each
`HasPagination` type-class. However, this can be overwritten when defining a instance of that

This comment has been minimized.

Copy link
@alpmestan

alpmestan Apr 17, 2018

Contributor

for each HasPagination instance, I suppose?

This comment has been minimized.

Copy link
@KtorZ

KtorZ Apr 17, 2018

Author Contributor

Indeed!

hide in shame

This comment has been minimized.

Copy link
@KtorZ

KtorZ Apr 17, 2018

Author Contributor

Fixed in 93838ae

@alpmestan alpmestan merged commit 6af3835 into haskell-servant:master Apr 17, 2018

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
@alpmestan

This comment has been minimized.

Copy link
Contributor

commented Apr 17, 2018

Thanks @KtorZ!

Your recipe should appear on https://haskell-servant.readthedocs.io/en/latest/cookbook/index.html (note the latest in the URL, which reflects the docs for the master branch, as opposed to stable which has the docs for the latest release) soon (15 mins IIRC? something along those lines).

@KtorZ

This comment has been minimized.

Copy link
Contributor Author

commented Apr 17, 2018

Awesome! 🎉

@alpmestan

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.