A Groovy Discriminated Union

Here’s a link to a Groovy discriminated union implementation.

About Discriminated Unions

Discriminated unions provide support for values that can be one of a number of named cases, possibly each with different values and types. Discriminated unions are useful for heterogeneous data:

  • Data that can have special cases, including valid and error cases
  • Data that varies in type from one instance to another
  • As an alternative for small object hierarchies.

 

 

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s