Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example for Parser.float does not type check #12

Open
timjs opened this issue Sep 4, 2018 · 0 comments
Open

Example for Parser.float does not type check #12

timjs opened this issue Sep 4, 2018 · 0 comments

Comments

@timjs
Copy link

timjs commented Sep 4, 2018

elmFloat : Parser Float
elmFloat =
  oneOf
    [ symbol "."
        |. problem "floating point numbers must start with a digit, like 0.25"
    , float
    ]

should be

elmFloat : Parser Float
elmFloat =
  oneOf
    [ symbol "."
        |> andThen (always <| problem "floating point numbers must start with a digit, like 0.25")
    , float
    ]

The (|.) operator keeps left and drops right and thus gives something of type Parser () in the first listing which clashes with Parser Float.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant