Re: [Haskell-cafe] Predicates in data types

2012-12-12 Thread Ertugrul Söylemez
Navid Hallajian wrote: > I'm a beginner in Haskell, so forgive me if this is a basic question, > but I'd like to know if it's possible to have a predicate as part of a > data type, so that when the data type is created, it can only be done > if it satisfies the predicate else a type error is thro

Re: [Haskell-cafe] Predicates in data types

2012-12-12 Thread Ivan Lazar Miljenovic
On 12 December 2012 21:57, Navid Hallajian wrote: > Hello, > > I'm a beginner in Haskell, so forgive me if this is a basic question, but > I'd like to know if it's possible to have a predicate as part of a data > type, so that when the data type is created, it can only be done if it > satisfies th

[Haskell-cafe] Predicates in data types

2012-12-12 Thread Navid Hallajian
Hello, I'm a beginner in Haskell, so forgive me if this is a basic question, but I'd like to know if it's possible to have a predicate as part of a data type, so that when the data type is created, it can only be done if it satisfies the predicate else a type error is thrown. For instance, a matr