roc-parser
roc-parser copied to clipboard
Apply and keep are the same function
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
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,
}