Closed copy closed 6 years ago
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?
Would you like a speedy release to opam?
Whenever it's convenient.
@copy, I'm sure you got the emails already, but this is now in opam as lambdasoup
0.6.3.
I'm trying to use the
Soup.create*
api to build up a lambdasoup object manually. This involves conditionally returning nodes created with eitherSoup.create_element
orSoup.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. acoerce : 'a node -> general node
(orelement node -> general node
).