Skip to content
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

element node to general node coercion #20

Closed
copy opened this issue May 28, 2018 · 3 comments
Closed

element node to general node coercion #20

copy opened this issue May 28, 2018 · 3 comments

Comments

@copy
Copy link
Contributor

copy commented May 28, 2018

I'm trying to use the Soup.create* api to build up a lambdasoup object manually. This involves conditionally returning nodes created with either Soup.create_element or Soup.create_text. However, the types of the two are incompatible, so I would like to coerce the more specific type (element node) to the more general one (general node), i.e. a coerce : 'a node -> general node (or element node -> general node).

@aantron aantron closed this as completed in ad069be Jun 1, 2018
@aantron
Copy link
Owner

aantron commented Jun 1, 2018

Thanks. I've also needed this function in my own work, and resorted to Obj.magic. There should now be Soup.coerce in master that does this. Would you like a speedy release to opam?

@copy
Copy link
Contributor Author

copy commented Jun 2, 2018

Would you like a speedy release to opam?

Whenever it's convenient.

@aantron
Copy link
Owner

aantron commented Jun 2, 2018

@copy, I'm sure you got the emails already, but this is now in opam as lambdasoup 0.6.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants