You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
case decode inp ofRight (opt ::Opt:_) -> doSomethingWith opt
Right[]-> oneKindOfError
Left (pos, err) -> anotherKindOfError
and inp is something like
---
foo: bar
...
baz
then I get an error when it hits baz, even though it can successfully parse the one YAML document I'm asking for. Is this expected? Could the parser be made lazier, so it returns the result after having parsed the first YAML document in the stream, and doesn't worry about the rest unless I ask for it?
Alternatively, could there be an option telling it to ignore non-YAML content after the first YAML document, if you just use decode1?
The text was updated successfully, but these errors were encountered:
Sorry, my question was ill-posed. I see why it can't be lazy if it's returning an Either value.
I guess the real question is whether another function might be made available that lazily returns a list of YAML documents (with no error return values).
If I do
and
inp
is something likethen I get an error when it hits
baz
, even though it can successfully parse the one YAML document I'm asking for. Is this expected? Could the parser be made lazier, so it returns the result after having parsed the first YAML document in the stream, and doesn't worry about the rest unless I ask for it?Alternatively, could there be an option telling it to ignore non-YAML content after the first YAML document, if you just use
decode1
?The text was updated successfully, but these errors were encountered: