
Hello there. I don't know if it's off topic, but I don't know where else to ask. I've been using Text.Xhtml.Strict, and I'm wondering why the functions are mostly Html -> Html and not HTML a => a -> Html, or something similar. If they were like this, << and toHtml would be not needed, what would make it simpler to call the functions with arguments that are not Html. The question is specific to this library, but I think it's a very general one: isn't it better to have more generic functions with type changing inside? It seems to me that it would make things better from the users point of view. What do you think? -- Marco Túlio Gontijo e Silva Blog: http://marcotmarcot.blogspot.com/ Página: http://marcotmarcot.googlepages.com/ Correio, Jabber, GTalk, MSN: marcotmarcot@gmail.com IRC: marcotmarcot@irc.freenode.net IRC: marcotmarcot@irc.indymedia.org Skype: marcotmarcot Telefone: 33346720 Celular: 98116720 Endereço: Rua Paula Cândido, 257/201 Gutierrez 30430-260 Belo Horizonte/MG Brasil

On Sat, 25 Aug 2007, Marco Túlio Gontijo e Silva wrote:
Hello there.
I don't know if it's off topic, but I don't know where else to ask.
I've been using Text.Xhtml.Strict, and I'm wondering why the functions are mostly Html -> Html and not HTML a => a -> Html, or something similar. If they were like this, << and toHtml would be not needed, what would make it simpler to call the functions with arguments that are not Html.
The question is specific to this library, but I think it's a very general one: isn't it better to have more generic functions with type changing inside? It seems to me that it would make things better from the users point of view. What do you think?
The disadvantage of more generic types is that they reduce the possibilities of type inference by the compiler. In the case of HTML generation it might still work well, that is, you could live without type annotations.
participants (2)
-
Henning Thielemann
-
Marco Túlio Gontijo e Silva