4 ms·
Ever since looking at SML, I often find myself thinking: "Would this be nice in SML?". And then I imagine all the nice pattern matching and type checking shorte
by zelphirkalt 3y ago
Ever since looking at SML, I often find myself thinking: "Would this be nice in SML?". And then I imagine all the nice pattern matching and type checking shortening the code. So any post about some library for SML raises my interest.
Having only learned from a book and with very few and little projects in SML, I have no idea, how they managed to put the HTML syntax in there. Clearly the carets are a start and the dollar signs the end delimiter, but then there are also things like backticks in there, before strings, which remind me of unquote of lisp. But why would one need to unquote strings? Anyway, it does look elegant. Maybe an example of how to compose HTML from multiple parts would also be great to have as an example (-> template engine).
Can anyone shed light on the general approach with ^^ and $$ this is implemented in SML? What kind of language constructs are involved?
EDIT: Also interesting, that they have written their own Test thingy: https://github.com/OriRoth/flunct/blob/main/test/test.sml#L4 https://github.com/OriRoth/flunct/blob/main/test/test.sml#L4
- OriRoth 3y ago> Maybe an example of how to compose HTML from multiple parts would also be great to have as an example (-> template engine). There are examples in the paper https://dl.acm.org/doi/10.1145/3586057 https://dl.acm.org/doi/10.1145/3586057 (last section I think).
- zelphirkalt 3y agoThanks for that! Looks great. For anyone else looking: I think it is page 23 (105:23).