From: "François Bobot" <francois.bobot@cea.fr>
To: Anton Bachin <antonbachin@yahoo.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] [ANN] Lambda Soup - HTML scraping and rewriting with CSS selectors
Date: Mon, 23 Nov 2015 11:44:12 +0100 [thread overview]
Message-ID: <5652EDFC.5070105@cea.fr> (raw)
In-Reply-To: <1A569326-8749-4332-A88C-719165728F20@yahoo.com>
On 22/11/2015 08:58, Anton Bachin wrote:
>> Does the types are as powerful as the one in tyxml? Is it possible to have
>> this kind of selectors on top of tyxml?
>
> The types are not as powerful as the ones in tyxml, in the sense of being
> precise. Lambda Soup only distinguishes between "definitely elements",
> "definitely documents", and "anything, including an element, or document, or any
> other node". It doesn't know about element types or any constraints on their
> composition.
>
> It does, however, seem to be possible to have the selectors on top of tyxml. I
> am not very familiar with tyxml, but I do see types Xml.elt and Xml.econtent,
> and value content. It may be possible to either use those directly as the
> internal DOM representation of Lambda Soup, and build traversals over them, and
> it is almost certainly possible to convert them to Lambda Soup's current
> internal representation, the same way Lambda Soup currently converts Nethtml’s
> parse trees.
Nice to know.
> If there is interest in this, perhaps with some study Lambda Soup can be
> modified to use tyxml – perhaps functorized.
It is just for not creating another xml type and simpler composition of ocaml libraries.
The functor solution used by cohttp (for allowing lwt or async) for example is a nice one, and
flambda should eliminate most of the cost of it (on a side note, does @inline work for functor
application?)
However in this case since the differences is about typing and not just the implementation, I'm not
sure you can define a generic functor that could be applied with instance (NetHttp, tyxml, yours)
that restricts differently the function applications.
--
François
next prev parent reply other threads:[~2015-11-23 10:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-16 21:01 Anton Bachin
2015-11-17 9:31 ` François Bobot
2015-11-22 7:58 ` Anton Bachin
2015-11-23 10:44 ` François Bobot [this message]
2015-11-23 16:26 ` Anton Bachin
2015-11-23 17:16 ` Drup
2015-11-23 17:35 ` Anton Bachin
2015-11-23 17:41 ` Anton Bachin
2015-11-23 18:20 ` Drup
2015-11-23 19:02 ` Anton Bachin
2015-11-24 8:35 ` François Bobot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5652EDFC.5070105@cea.fr \
--to=francois.bobot@cea.fr \
--cc=antonbachin@yahoo.com \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox