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

Type safe templating (with mustache) #128

wants to merge 8 commits into
base: master
Choose a base branch

Type safe templating (with mustache) #128

wants to merge 8 commits into from


Copy link

@Drup Drup commented Apr 18, 2016

This is WIP.

open Tyxml

let%template f ={|
Hello {{name}}, You are {{{desc}}}
  <b>{{foo}}</b> {{name}}
  No foos :(

val f :
  name:bytes ->
  list:< foo : bytes; .. > list ->
  desc:([> `B | `PCDATA ] as 'a) Tyxml_html.elt list ->
  'a Tyxml_html.elt list

Current issues:

  • Locations are completely lost (because of the mustache implementation)
  • Nesting is untested
  • Can't specify a name relative to the current context. Names are always resolved from the top context.

Copy link

aantron commented Apr 19, 2016

I think this is (potentially) a great idea, but I don't think TyXML should offer two PPXs as in the attached commits. Ideally, there would be "one great TyXML PPX" that offers this and whatever other features. Otherwise, we are likely to confuse new users and make them anxious about going down the wrong path with their code.

Copy link
Member Author

Drup commented Apr 16, 2018

If people want this to happen, please voice your opinion on the choice of the templating language in .

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

Successfully merging this pull request may close these issues.

None yet

2 participants