On Fri, May 15, 2015 at 7:59 AM, Jonathan S. Shapiro <[email protected]> wrote:
> So I have a "how do I use this idiomatically" sort of question...
>
> In ML/Haskell and friends, there is no syntactically simple way to say "all
> legs of this union have the following fields in common". You either build a
> structure with the common fields and mention it explicitly in every leg of
> the union, or (conversely) you make the union an element of a larger
> structure.
>
> AST nodes are a use case. They tend to have a large number of common
> metadata fields (position, type, auxiliary marker bits of various sorts...)
> and a small variant part describing the children of the node.
>
> Is there a common idiom that people use in cases like this?

in ML i've always used the latter, where the common elements and the
union are elements of a larger structure
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to