[PRL] IOP and disjoint unions

Paul A. Steckler steck at stecksoft.com
Thu Apr 28 15:57:16 EDT 2005


> What's wrong with a separate interface for each variant?  In ML, you
> have a separate type for each variant, and interfaces have a lot in
> common with types.  

I'm confused by this comment.

In ML or Haskell, I write something like

  data Foo = Bar Int
           | Baz String
           | Quux Char

Each of these expressions

  Bar 42
  Baz "42"
  Quux 'Q'

has type Foo.

-- Paul



More information about the PRL mailing list