If you're writing a library, the general rule is to keep union types opaque 
(i.e. the type itself is exported but the tags are not). This allows you to 
add or remove tags as you need to without committing to a major version 
bump. If you wanted to export some of the tags, you'd have to export some 
functions that wrap them. At that point, you might as well go with option 2.

A union type is really good for "this value will be one of a few possible 
things". But you have a slightly different problem: "this value will come 
from one of a few possible places, but the shape of the value itself it 
always the same". So go with option 2, the "factory" functions.

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to