Re: [Haskell-cafe] Constructor constraints

2005-09-20 Thread Rich Neswold
On 9/20/05, Malcolm Wallace <[EMAIL PROTECTED]> wrote: You can make a 'smart' constructor function, and hide the real dataconstructor so that it cannot be used:Thanks! I'll give your solution a try.-- RichAIM : rnezzy ICQ : 174908475 ___ Haskell-Cafe mail

Re: [Haskell-cafe] Constructor constraints

2005-09-20 Thread Malcolm Wallace
Rich Neswold <[EMAIL PROTECTED]> writes: > For instance, I want to make a new type that is a 4 element tuple > where each element is greater than or equal to the previous entry. > > data Category = Membership a a a a You can make a 'smart' constructor function, and hide the real data constructo

[Haskell-cafe] Constructor constraints

2005-09-20 Thread Rich Neswold
Hello,I've looked through the two tutorials and the Report, but couldn't find help on this topic. My question is whether you can place constraints on new data types. For instance, I want to make a new type that is a 4 element tuple where each element is greater than or equal to the previous entry.