[Haskell-cafe] Re: A Question of Restriction

2009-07-27 Thread Gleb Alexeyev
Brian Troutwine wrote: Do you have any reason not to do the above? Yes, the subset types that I wish to define are not clean partitions, though my example does suggest this. Let's say that the definition of Foo is now data Foo = One | Two | Three | Four | Five | Six while Odd and Even

[Haskell-cafe] Re: A Question of Restriction

2009-07-26 Thread Ahn, Ki Yung
Brian Troutwine wrote: Hello all. I would like to define a data type that is the super-set of several types and then each of the proper subset types. For example: data Foo = One | Two | Three | Four data Odd = One | Three data Even = Two | Four This, of course, does not work. It