If you are parsing JSON, the values can be strings, floats, booleans,
arrays, objects, or null. You need a way to pick oneOf them! Here is a
sample of what that code might look like:
Ignore the type signature at the top of this page. It is showing the first
of several overloaded definitions. Instead, think of it as having the type
signature oneOf<A>(...parsers: Parser<A>[]): Parser<A>
See
oneOfMany like oneOf but with different type inference.
If you are parsing JSON, the values can be strings, floats, booleans, arrays, objects, or null. You need a way to pick
oneOf
them! Here is a sample of what that code might look like:Example
Remark
Ignore the type signature at the top of this page. It is showing the first of several overloaded definitions. Instead, think of it as having the type signature
oneOf<A>(...parsers: Parser<A>[]): Parser<A>
See
oneOf
but with different type inference.