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

provide pattern synonyms #66

Open
winterland1989 opened this issue Oct 12, 2016 · 3 comments
Open

provide pattern synonyms #66

winterland1989 opened this issue Oct 12, 2016 · 3 comments

Comments

@winterland1989
Copy link

I think it's a good idea to provide pattern synonyms for Header/Method/Status... along aside constants, so people can match them with ease.

@aristidb
Copy link
Owner

Pull requests accepted. :)

@winterland1989
Copy link
Author

winterland1989 commented Oct 19, 2016

OK, here's a plan of attack and some design questions:

Which naming conventions? overall we want these patterns to be convenient both w/wo qualification, i can come with following choices(take Method as an example):

  • pattern GET = "GET"

  • pattern Get = "GET"

  • pattern MethodGet = "GET"

  • pattern METHOD_GET = "GET"

    I'm inclined to the first one and last one, but the third one is acceptable to me.

I'd like to use ViewPatterns to deal with HeaderName, but i'm not sure we should provide pattern for Header or HeaderName, i'm inclined to provide Header pattern like pattern HEADER_ACCEPT h <- (foldCase -> "accept", h), but it's maybe a little complex.

We have to provide pattern METHOD_OTHER m = m for sure, or METHOD_NONSTANDARD?

@aristidb
Copy link
Owner

I think I like "MethodGet".

I'm not sure about whether it should be Header or HeaderName, but I think the foldCase should not be necessary, as OverloadedStrings is supported by the CI type. (Untested.)

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

2 participants