evancz / url-parser

Parse URLs into nicely structured data
http://package.elm-lang.org/packages/evancz/url-parser/latest/
BSD 3-Clause "New" or "Revised" License
114 stars 29 forks source link

Example shows use of UrlParser.format; does not exist in 2.0? #15

Closed inactivist closed 7 years ago

inactivist commented 7 years ago

Found this while porting some code from Elm 0.17 to 0.18.

README.md and examples/App.elm reference UrlParser.format function, though it appears to have been removed in the 2.0 release.

type DesiredPage = Blog Int | Search String

desiredPage : Parser (DesiredPage -> a) a
desiredPage =
  oneOf
    [ format Blog (s "blog" </> int)
    , format Search (s "search" </> string)
    ]
process-bot commented 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.

sporto commented 7 years ago

This is now called map

prikhi commented 7 years ago

Working on getting the example & readme up to date, will submit PR today.

inactivist commented 7 years ago

Thanks, I hoped to submit a PR to fix it but probably won't get to it for a few days at least.

prikhi commented 7 years ago

PR submitted, not sure if my solution is the golden path, it's just what I did for my app. Feedback welcome.

evancz commented 7 years ago

The README and examples are now updated. Sorry for the confusion!

inactivist commented 7 years ago

Thanks for the quick turnaround. I'll try "pitch in" somewhere around here...

evancz commented 7 years ago

Don't feel pressure to contribute through code! I think it's a weird pathology in programming communities that folks think "it doesn't count" if there's not something merged into master.

Opening a high-quality issue like this (where you explain how the problem appeared in practice, provide nice links to mistakes, and give a clear summary in the issue itself) is a great kind of contribution. Creating nice issues is a skill that very few people have (based on my observations) and this one is particularly well done!

In any case, I talk about this more in Code is the Easy Part because I think there are lots of folks who make great contributions, but this ambient culture around PRs hide this and encourage less efficient collaboration. Point is, thanks for reporting this :)

inactivist commented 7 years ago

Don't feel pressure to contribute through code! I think it's a weird pathology in programming communities that folks think "it doesn't count" if there's not something merged into master.

@evancz -- Thanks for the kind words. I don't feel that way at all, FWIW. Cheers!