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
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).
The text was updated successfully, but these errors were encountered:
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?
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
).The text was updated successfully, but these errors were encountered: