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

Derive Show instances for route data structures #1492

Merged
merged 1 commit into from Mar 5, 2018

Conversation

Projects
None yet
2 participants
@MaxGabriel
Copy link
Member

MaxGabriel commented Mar 4, 2018

I haven't looked into this much, but if someone knows offhand, what is the use case for Piece and Dispatch being parametrized data types? It seems like they would most always be String?

Before submitting your PR, check that you've:

  • Bumped the version number

After submitting your PR:

  • Update the Changelog.md file with a link to your PR
  • Check that CI passes (or if it fails, for reasons unrelated to your change, like CI timeouts)
Derive Show instances for route data structures
* It's very helpful to have a Show instance for debugging and development
* Currently third party packages are deriving this instance themselves which is not ideal.
    * http://hackage.haskell.org/package/yesod-routes-flow-2.0/docs/src/Yesod-Routes-Flow-Generator.html
    * http://hackage.haskell.org/package/yesod-routes-typescript-0.3.0.0/docs/src/Yesod-Routes-Typescript-Generator.html
    * This change would break those packages, which isn't great
         * At least the typescript one is broken anyway

@MaxGabriel MaxGabriel force-pushed the showRoutes branch from de2797b to 08ef0e2 Mar 5, 2018

@MaxGabriel

This comment has been minimized.

Copy link
Member Author

MaxGabriel commented Mar 5, 2018

Since yesod-routes-flow is being actively developed, I think a good solution is to have a preprocessor macro that says that if yesod-core is >= this version, then don't derive the show instances.

Edit: created a PR freckle/yesod-routes-flow#4

@MaxGabriel

This comment has been minimized.

Copy link
Member Author

MaxGabriel commented Mar 5, 2018

Honestly seems like I should also basic typeclasses like Eq and Ord as well.

@snoyberg
Copy link
Member

snoyberg left a comment

LGTM!

@snoyberg snoyberg merged commit cb229cf into master Mar 5, 2018

2 of 4 checks passed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
continuous-integration/travis-ci/push The Travis CI build could not complete due to an error
Details
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@snoyberg snoyberg deleted the showRoutes branch Mar 5, 2018

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.