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

Apply and keep are the same function #26

Open
thenikso opened this issue Dec 3, 2024 · 1 comment
Open

Apply and keep are the same function #26

thenikso opened this issue Dec 3, 2024 · 1 comment

Comments

@thenikso
Copy link

thenikso commented Dec 3, 2024

Hey, checking out the code of this excellent parser. really enjoying using it!

I just noticed that apply and keep are the same function but implemented with different syntax.

I personally prefer the keep naming and the apply body :D

@thenikso
Copy link
Author

thenikso commented Dec 3, 2024

on a somewhat unrelated note, I was checking that apply code when trying to use the record builder syntax which works! In the "parseGame" function in the main example one could write:

    game =
        { map2 <-
            id: const (\id -> id) |> skip (string "Game ") |> keep digits |> skip (string ": "),
            requirements,
        }

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