Re: [Haskell-cafe] A question about constraints

2008-10-03 Thread Luke Palmer
On Thu, Oct 2, 2008 at 7:51 AM, jean-christophe mincke <[EMAIL PROTECTED]> wrote: > Hello, > > Thank you for your comments. > > Would not it be feasible to add constraints at type definition, something > like, in a somewhat free style syntax > > data String2 = String2 (s::String) with length s <=

Re: [Haskell-cafe] A question about constraints

2008-10-02 Thread Luke Palmer
On Thu, Oct 2, 2008 at 4:11 AM, Bulat Ziganshin <[EMAIL PROTECTED]> wrote: > finally, ghc now includes some form of active patterns which may be > used to define your own way to decompose values. but their syntax > isn't compatible with constructors so you can't define complex type > which mimicks

Re: [Haskell-cafe] A question about constraints

2008-10-02 Thread Bulat Ziganshin
Hello jean-christophe, Thursday, October 2, 2008, 1:46:20 PM, you wrote: > If one wants to use pattern matching, afaik we had so-called views in early haskell versions. they proivide way to define two-way constructors - used for deconstruction via pattern-matching too views wa removed from hask

Re: [Haskell-cafe] A question about constraints

2008-10-02 Thread minh thu
2008/10/2 jean-christophe mincke <[EMAIL PROTECTED]>: > Hello, > > Given a type T, this type identifies a set of values and this set can be > deduced from the structure of type T. > > i.e the type String is the set of all possible lists of character whatever > their length. > > This being said, I

[Haskell-cafe] A question about constraints

2008-10-02 Thread jean-christophe mincke
Hello, Given a type T, this type identifies a set of values and this set can be deduced from the structure of type T. i.e the type String is the set of all possible lists of character whatever their length. This being said, I have the following question: Given a type T, how is it possible to f