<div class="gmail_quote">On Fri, Mar 5, 2010 at 4:48 AM, iquiw <span dir="ltr"><<a href="mailto:iku.iwasa@gmail.com">iku.iwasa@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Johan,<br>
<div class="im"><br>
On Fri, Mar 5, 2010 at 6:18 AM, Johan Tibell <<a href="mailto:johan.tibell@gmail.com">johan.tibell@gmail.com</a>> wrote:<br>
> Here's a proposal for a project I'd be willing to mentor:<br>
> = A high-performance HTML combinator library using Data.Text =<br>
<br>
</div>Nice project! I would like to see the project will be accepted.<br>
<br>
Perhaps it's not scope of the project, but if compatibility doesn't<br>
matter, I want new HTML library have uniform naming convention<br>
for functions that based on element or attribute.<br>
<br>
For example, function name should be;<br>
- "e_" + element name ("html", "head", "body" => "e_html", "e_head", "e_body")<br>
"a_" + attribute name ("href", "id", "class" => "a_href", "a_id", "a_class")<br>
or<br>
- "e" + capitalized element name ("html", "head", "body" => "eHtml",<br>
"eHead", "eBody")<br>
"a" + capitalized attribute name ("href", "id", "class" => "aHref",<br>
"aId", "aClass")<br>
<br>
or some other convention.<br></blockquote><div><br></div><div>I think I would use the module system for namespacing rather than using function prefixes. Like so:</div><div><br></div><div>import Text.Html as E</div><div>import qualified Text.Html.Attribute as A</div>
<div><br></div><div>E.html ! [A.class_ "my-class"] (... more combinators ...)</div><div> </div><div>(Assuming that "!" is used to introduce attributes.)</div><div><br></div><div>This allows you to use the element names and/or the attribute names unclassified if you so desire.</div>
<div><br></div><div>html ! [class_ "my-class"] (... more combinators ...)</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Function names in the 'html' library are unpredictable from<br>
corresponding element/attribute names...<br>
("head", "base", "a" => "header", "thebase", "anchor")<br></blockquote><div><br></div><div>I'm of the same opinion. The combinators should match the element/attribute names as far as possible. The rule that I had in mind was that the combinators should have exactly the same name as the corresponding element/tag except when the name collides with a keyword (e.g. "class"). If the name collides with a keyword we could e.g. always append a "_".</div>
<div> </div><div>Cheers,</div><div>Johan</div><div><br></div></div>