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

Deprecate PathPiece? #5

Closed
fizruk opened this issue Oct 4, 2015 · 6 comments
Closed

Deprecate PathPiece? #5

fizruk opened this issue Oct 4, 2015 · 6 comments

Comments

@fizruk
Copy link
Owner

fizruk commented Oct 4, 2015

No description provided.

@gregwebs
Copy link
Contributor

gregwebs commented Oct 4, 2015

I think the best course of action is to keep the path-pieces package but release a new version with the changes to the TypeClass that you made here. Otherwise we are in the position of 2 packages defining the same typeclass. After that release we can switch packages that depend on path-pieces package over to http-api-data and then finally deprecate path-pieces. Does that make sense?

@fizruk
Copy link
Owner Author

fizruk commented Oct 4, 2015

Yes, this totally makes sense!

@fizruk
Copy link
Owner Author

fizruk commented Oct 11, 2015

In order to deprecate path-pieces package we need to deal with PathMultiPiece.

It seems that PathMultiPiece is only used for [a].
If this is true, we can simply eliminate the class and provide corresponding functions:

toUrlPieces :: ToHttpApiData a => [a] -> [Text]
toUrlPieces = fmap toUrlPiece

parseUrlPieces :: FromHttpApiData a => [Text] -> Either Text [a]
parseUrlPieces = traverse parseUrlPiece

@gregwebs
Copy link
Contributor

I suspect the idea of PathMultiPiece is that it allowed flexibility for user definitions, but I have never used this feature (and it is rarely used in general). @snoyberg might be able to provide more insight.

@snoyberg
Copy link
Collaborator

That's probably a reasonable simplification

@fizruk
Copy link
Owner Author

fizruk commented Feb 21, 2018

Closing this since yesodweb/path-pieces#13 exists.
Feel free to reopen if you have anything to add :)

@fizruk fizruk closed this as completed Feb 21, 2018
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

No branches or pull requests

3 participants