The docs for Url.Parser.custom
give an example:
int : Parser (Int -> a) a
int =
custom "NUMBER" String.toInt
But don't indicate what "NUMBER"
is used for.
I checked the source and it seems to be capture as tipe
, but never used:
custom : String -> (String -> Maybe a) -> Parser (a -> b) b
custom tipe stringToSomething =
Parser <| \{ visited, unvisited, params, frag, value } ->
case unvisited of
[] ->
[]
next :: rest ->
case stringToSomething next of
Just nextValue ->
[ State (next :: visited) rest params frag (value nextValue) ]
Nothing ->
[]
So:
tipe
?Evan has addressed this in the following GitHub Issue: https://github.com/elm/url/issues/6
tl;dr: It does nothing but is there for future use.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With