-
Notifications
You must be signed in to change notification settings - Fork 50
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
Extend from Parser #284
Extend from Parser #284
Conversation
Extending from Parser adds some convenience methods to the Parser out of the box, such as `decodeAccumulating`. The parser package object already matches the Parser interface.
(As an aside, I see that readme in this repo still names Travis as a maintainer.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this!
@TimoMeijer A preemptive approval when I thought I saw it green on my part. So it looks like things run fine on 2.11, and 2.12. On 2.13 however, when extending Parser on the package object it compiles, but ends up acting as if the |
I can see if I can reproduce this locally tomorrow, and if so, investigate further |
The compile error actually occurs in both 2,12 and 2.13, but not in 3. |
Minimal example of the behavior: https://gist.github.com/TimoMeijer/bef21c11cb13fa283205de1dd32347d2 |
That looks to track with what we found when we were looking at things, I missed the 2.12 failure though but that makes sense. |
@zmccoy Would it make sense to split the implementation of parser between 2.x and 3.x, as we can support this behavior on 3.x already? Or would we not want to implement this, and have the inconsistency between circe and circe-yaml until 2.x support is dropped? Or check if there might be any workarounds? |
Sorry, I know I don't maintain this anymore. But I want to ask: Do you want to I'd hope it's not the former, because you can't substitute a JSON parser for a YAML parser (nor vice versa, necessarily). I'd hope it's not the latter, because those methods aren't special enough to couple these. Just my opinion as an ex-maintainer. |
Thanks for your thoughts @jeremyrsmith! My original case was that I wanted to use You're of course completely right that simply copying over @jeremyrsmith, is your point that we should add these convenience methods, but not through extending from |
@TimoMeijer I guess my point is that, in Another solution would be to pull out the implementation in question to a function. Would that seem silly for the method in question? Again, sorry to butt in here. Not trying to imply I have answers. But extending |
Whops, sorry, was working on an alternative and accidentally pushed into master... I've fixed that, this isn't really merged in.. 😞 |
@TimoMeijer Thoughts on #338? |
Seems like a clean workaround! On 4 Nov 2022 22:58, Darren Gibson ***@***.***> wrote:
@TimoMeijer Thoughts on #338?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Extending from Parser adds some convenience methods to the Parser out of the box, such as
decodeAccumulating
.The parser package object already matches the Parser interface.
Relates to #199