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

Url.Parser.parse seems to have wrong type signature #22

Closed zeninpalm closed 5 years ago

zeninpalm commented 5 years ago

Hello everyone, I'm reading Url.Parser source code to understand Elm's url parsing mechanism. I noticed that the type signature of parse function to be:

parse : Parser (a -> a) a -> Url -> Maybe a

Is that signature correct? But I think the correct signature should be:

parse : Parser (a -> b) b -> Url -> Maybe b

Did I misunderstand something here? Would anyone please give me a hint, thank you very much!

evancz commented 5 years ago

These sorts of questions get answered more quickly in community forums, so I recommend asking around on https://discourse.elm-lang.org/ or on http://elmlang.herokuapp.com/ or on https://www.reddit.com/r/elm/