-
Notifications
You must be signed in to change notification settings - Fork 135
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
Simplify RoutePattern type #156
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add resourcet dep
Adding new route matching data-type "RoutePattern".
but scotty.cabal does not depend on wai-extra, add documentation
…onse Add "source" function to construct response directly from a Source
Document that basic.hs imports Network.Wai.Middleware.RequestLogger which requires wai-extra
Using scotty with settings
Depend on hspec-2.*
this is relevant to issue scotty-web#131 in current implementation it is still usafe to mix body/jsonBody and bodyReader
this makes it safe to call body(or something that uses it) and then use bodyReader. Calling bodyReader will cause subsequent calls to body to result in a BodyPartiallyStreamed exception. still a bit rough around the edges and might require some exception handling when working with mvars (bracket). fixes scotty-web#131
Streaming uploads
hlint suggestion
Add instance Parsable LazyByteString
Add comment in basic.hs for next
Remove redundant lambda
Fix for monad-control-1.0.0.0
Add scottySocketT and scottySocket, exposing Warp Unix socket support
Modified leak of the header
Added support for OPTIONS routes
Use data-default-class instead of data-default
this PR is massive and unreviewable by me. closing, but i will open an issue for me to investigate. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a proof-of-concept intended to provoke some discussion about why the
RoutePattern
data type is as it is, and whether it can be modified to give users more power to write modular routing code.I would like to write combinators for
RoutePattern
s, but it isn't possible to do anything very useful without duplicating the code that is in the internal functionmatchRoute
. Examples of usefulRoutePattern
combinators would be matching either of two patterns, or both.However, I noticed that
matchRoute
turns anyRoutePattern
into a function that would fit in theFunction
constructor. So, why do we need the other constructors?This patch shows that if we move the logic from
matchRoute
out into thecapture
andliteral
functions, then the need for the variousRoutePattern
ADT constructors vanishes, and thus users' own combinators for routes no longer need to handle the different cases ofRoutePattern
.