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

Remove the type class #113

Merged
merged 4 commits into from
Apr 23, 2019
Merged

Remove the type class #113

merged 4 commits into from
Apr 23, 2019

Conversation

parsonsmatt
Copy link
Collaborator

This PR removes the type class from esqueleto and simplifies all relevant types.

@FintanH
Copy link
Collaborator

FintanH commented Feb 1, 2019

Fantastic ❤️

@parsonsmatt
Copy link
Collaborator Author

@bitemyapp This is a big breaking change. Think we should lodge this in a 3.0 release or 2.8?

@bitemyapp
Copy link
Owner

@parsonsmatt Based on http://hackage.haskell.org/package/esqueleto, I'd say this is a 3.0.

@parsonsmatt
Copy link
Collaborator Author

@akurilin I know y'all use this library a lot. Would this change harm your code base? I'm going to check with Lumi's codebase as well.

For some additional motivation for this change, I'm working on some complicated SQL logic. Somehow, the type is getting fixed to Esqueleto Ratio SqlQuery SqlBackend, and it's giving all kinds of totally useless errors. I know this is a simple type error. If the type were concrete, then I'd get an immediate pointer to where SqlExpr is getting confused with Ratio.

@eborden
Copy link

eborden commented Apr 19, 2019

@parsonsmatt This is a breaking change for us (Freckle). Though it is a breaking change I'd welcome.

@cdparks
Copy link
Contributor

cdparks commented Apr 19, 2019

I think there are only two places we'd need to update. All of our other helpers use concrete SqlQuery and SqlExpr.

@parsonsmatt
Copy link
Collaborator Author

@eborden @cdparks Is it just a mechanical translation from Esqueleto e q b => e x -> q (e y) to SqlExpr x -> SqlQuery (SqlExpr y), or is there some functionality that would be lost with this?

@cdparks
Copy link
Contributor

cdparks commented Apr 19, 2019

Yeah, that's exactly the change we'd have to make. We wouldn't lose any functionality, and the upgrade path is like a one-liner.

@andrewthad
Copy link

I use a little bit of esqueleto in about a dozen different projects. I've never seen any value in having the typeclass since there's only one possible instance of it. I would be happy to see it go away.

@eborden
Copy link

eborden commented Apr 22, 2019

@parsonsmatt FYI, @cdparks has already fixed this in our codebase. All uses were unnecessary. The transition will now be painless.

@parsonsmatt
Copy link
Collaborator Author

Thanks @eborden @cdparks :)

@parsonsmatt parsonsmatt merged commit a0274e3 into master Apr 23, 2019
@parsonsmatt parsonsmatt deleted the matt/remove-class branch September 24, 2020 16:08
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.

6 participants