Closed ckoster22 closed 7 years ago
Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!
Here is what to expect next, and if anyone wants to comment, keep these things in mind.
I don't think it makes sense to add a (<&>)
operator. I assume you are suggesting it has the same type as (<?>)
which would mean you could use them interchangeably. I think that is more confusing than using <?>
multiple times personally.
Maybe you are suggesting something else, but there are no types shown here, so I don't know. Overall, I don't think it makes sense to add <&>
.
You're correct that I'm suggesting having an (<&>)
operator, if not some documentation on how to use multiple query parameters, because it wasn't apparent to me until I read the source that I needed to use (<?>)
multiple times.
Whether the two operators can used interchangeably is more of an implementation concern, IMO. I'm commenting on the semantics of those operators.
s
corresponds to any string
</>
corresponds to a forward slash
<?>
corresponds to the start of a query string
<?>
also corresponds to a query string key/value separator?
Rather, <&>
makes perfect sense to me to correspond with the real "&" query string parameter separator.
Below is an elm-repl example simulating a user navigating to a URL like
http://localhost/blog?search=cats&order=desc
.(</>)
and(<?>)
are available but(<&>)
doesn't exist. As such I am forced to chain multiple(<?>)
functions in this part:(s "blog" <?> stringParam "search" <?> stringParam "order")
.The
<?>
followed by another<?>
doesn't read correctly since my URL is nothttp://localhost/blog?search=cats?order=desc
. I expected to find<&>
so that the code above could read like this:(s "blog" <?> stringParam "search" <&> stringParam "order")