Open ylixir opened 5 years ago
we should do this. the main tradeoff here is weaker type guarantees creating more implementation complexity.
the primary goal of this library is to make creating parsers as easy as possible.
i feel that the Php community will strongly prefer ease of use to guarantees of correctness, and the added complexity will not be visible to our users. in addition we have a good testing story to mitigate issues caused by this complexity
It might be nice to make
lit
implied when passing strings.p::or(p::lit("a"),p::lit("b"))
compared top::or("a","b")
.Concerns might be that we trade convenience for safety and speed.