[Haskell-cafe] Constructor constraints

Rich Neswold rich.neswold at gmail.com
Tue Sep 20 12:13:11 EDT 2005


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. Is this 
possible?

i.e.

data Category = Membership a a a a

I'd like to be able to prevent invalid Category data from being created. Any 
information would be appreciated.

-- 
Rich

AIM : rnezzy
ICQ : 174908475
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org//pipermail/haskell-cafe/attachments/20050920/7cd94207/attachment.htm


More information about the Haskell-Cafe mailing list