It does! Some users in the #beginner thread mentioned that had no idea the purpose of the first argument to the custom function. I took a look and it used to be used for error messages, but those have since been removed and the argument tipe is not used in the function. Here is an example of what the current use cases are in the documentation and what it would look like without the unused argument.
-- The int example in the docs. The confusion lay with the "NUMBER" argument.
int : Parser (Int -> a) a
int =
custom "NUMBER" String.toInt
-- The int example without the argument
int : Parser (Int -> a) a
int =
custom String.toInt
-- The CSS example in the docs. It is "CSS_FILE" here
css : Parser (String -> a) a
css =
custom "CSS_FILE" <| \segment ->
if String.endsWith ".css" segment then
Just segment
else
Nothing
-- The CSS example without the argument
css : Parser (String -> a) a
css =
custom
(\segment ->
if String.endsWith ".css" segment then
Just segment
else
Nothing
)
Hey!
I was informed that the Url Parser is being moved to this repository and to check and see if this issue still exists: https://github.com/evancz/url-parser/issues/51
It does! Some users in the #beginner thread mentioned that had no idea the purpose of the first argument to the
custom
function. I took a look and it used to be used for error messages, but those have since been removed and the argumenttipe
is not used in the function. Here is an example of what the current use cases are in the documentation and what it would look like without the unused argument.