[Haskell-cafe] Designing an object model in Haskell
Robin Bate Boerop
robin_bb at acm.org
Sun Dec 10 10:59:06 EST 2006
John,
For the particular object model that you are interested in (an HTML-
ish object model), you should check out the paper by Peter Thiemann
entitled "A Typed Representation for HTML and XML Documents in Haskell".
--
Robin Bate Boerop
http://robin.bateboerop.name
On 7-Dec-06, at 8:07 AM, John Ky wrote:
> Hi,
>
> I've got an object model that I have a difficult time
> conceptualising how it might look like in Haskell:
>
> class Element { }
>
> class Inline : Element { }
>
> class ParentInline : Inline {
> List<Inline> children;
> }
>
> class Bold : ParentInline { }
> class Underline : ParentInline { }
>
> class Link : ParentInline {
> String link;
> }
>
> class Text : Inline {
> String text;
> }
>
> class Block : Element { }
>
> class Paragraph : Block {
> List<Inline> paragraph;
> }
>
> class Heading : Block {
> List<Inline> heading;
> }
>
> class Document : Element {
> List<Block> blocks;
> }
>
> How best to represent this OO data model in Haskell?
>
> Thanks
>
> -John
More information about the Haskell-Cafe
mailing list