elm / url

Build and parse URLs. Useful for HTTP and "routing" in single-page apps (SPAs)
https://package.elm-lang.org/packages/elm/url/latest/
BSD 3-Clause "New" or "Revised" License
74 stars 43 forks source link

Docs for Url.Parser.Query.custom mention non-existing List.maybeMap #27

Closed Janiczek closed 3 years ago

Janiczek commented 5 years ago

https://package.elm-lang.org/packages/elm/url/latest/Url-Parser-Query#custom This is the example in the documentation:

posts : Parser (Maybe (List Int))
posts =
  custom "post" (List.maybeMap String.toInt)

-- ?post=2        == [2]
-- ?post=2&post=7 == [2, 7]
-- ?post=2&post=x == [2]
-- ?hats=2        == []

List.maybeMap doesn't exist.

sethlivingston commented 5 years ago

The correct function is List.filterMap. The PR fixes the docs.

evancz commented 3 years ago

Fixed in #28