lwd icon indicating copy to clipboard operation
lwd copied to clipboard

Add pure modules in Tyxml_lwd

Open tmattio opened this issue 5 years ago • 1 comments

Being able to use Lwd.t for every Tyxml_lwd element's parameter is awesome, but when writing large documents, that's a lot of Lwd.pure.

This PR adds two modules in Tyxml_lwd: Pure.Html, and Pure.Svg that are counterparts of the Html and Svg modules, but which functions take pure arguments and convert them to Lwd.t.

This allows to re-use "normal" Tyxml code with Lwd.

tmattio avatar Oct 28 '20 11:10 tmattio

Thanks for this work.

I understand that this make it easier to port existing code, however I am afraid this will grow the API unnecessarily.

I wonder if a set of well-designed combinators could reduce the friction of lifting non-reactive values, without introducing the confusion of having many large modules export similarly-named values with slightly differing types. I have a few ideas along these lines that I would like to experiment with.

In any case, these changes are meant to be used by opening a module at the beginning of some scope to shadow non-pure definitions? I would prefer putting these definitions in a separate library, say tyxml-lwd.pure for instance. (But I would happily change my mind if this proves to cumbersome :))

let-def avatar Nov 02 '20 09:11 let-def