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
Merged

Conversation

MaxGabriel
Copy link
Member

@MaxGabriel 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)

* 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
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
Copy link
Member Author

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

Copy link
Member

@snoyberg snoyberg left a comment

Choose a reason for hiding this comment

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

LGTM!

@snoyberg snoyberg merged commit cb229cf into master Mar 5, 2018
@snoyberg snoyberg deleted the showRoutes branch March 5, 2018 08:17
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