[Haskell-cafe] Text.Xhtml.Strict

Henning Thielemann lemming at henning-thielemann.de
Sun Aug 26 07:34:06 EDT 2007

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 

More information about the Haskell-Cafe mailing list