> Carl> I'm afraid this doesn't work.  There are two problems:
> Carl> 1) You need a constructor above:
> >> h1 (stringToHtml "This is a Header" (H1Args { align = Right}))
> Carl> or
> >> H1 { align = Right, html = stringToHtml "This is a Header" }

and Marko replied:
> h1 (stringToHtml "This is a Header") { align = AlignRight}
> works if h1 and stringToHtml are as follows
> stringToHtml s = Text { text = s }
> h1 h = H1 { inside = h }

Actually, what I intended was this:

h1 ((stringToHtml "This is a Header") {align = Right})

but I left out the inner parens in my first message (sorry).  I think
that this is the simplest, and preserves Andy's original types.

> Carl> 2) Missing fields in a labeled field constructor are initialized 
> Carl> to _|_ (bottom).  Thus, there's no safe way (in standard
> Carl> Haskell) to differentiate between

and Marko replied: 
> But you could attach default alignment when converting any type to
> Html
> stringToHtml s = Text { align = defaultAlignment, text = s }

Yes, this was my intention, as I remarked in my original message.

  -Paul


Reply via email to