Re: [Haskell-cafe] Constraints at construction

2008-10-12 Thread Iain Barnett
On 12 Oct 2008, at 9:28 pm, Henning Thielemann wrote: On Thu, 9 Oct 2008, Iain Barnett wrote: If I were to create an object in C#, for instance, I could add code to the constructor that might limit the type further e.g. public class Car { string model; int wheels;

Re: [Haskell-cafe] Constraints at construction

2008-10-12 Thread Henning Thielemann
On Thu, 9 Oct 2008, Iain Barnett wrote: If I were to create an object in C#, for instance, I could add code to the constructor that might limit the type further e.g. public class Car { string model; int wheels; public Car ( string model, int no_of_wheels ) {

Re: [Haskell-cafe] Constraints at construction

2008-10-11 Thread Bit Connor
On Thu, Oct 9, 2008 at 3:05 PM, Mitchell, Neil <[EMAIL PROTECTED]> wrote: > Hi Iain, > > The wiki page has quite a nice article: > http://www.haskell.org/haskellwiki/Smart_constructors Smart constructors are nice but if your module doesn't also export the regular constructor then you can't pattern

Re: [Haskell-cafe] Constraints at construction

2008-10-11 Thread Jake McArthur
On Oct 11, 2008, at 2:54 PM, Bit Connor wrote: Smart constructors are nice but if your module doesn't also export the regular constructor then you can't pattern match against it. It would be cool if there was a way to export constructors from a module, but only for use in pattern matching and

Re: [Haskell-cafe] Constraints at construction

2008-10-09 Thread Iain Barnett
Thankyou, this is exactly what I was looking for. Iain On 9 Oct 2008, at 2:05 pm, Mitchell, Neil wrote: Hi Iain, The wiki page has quite a nice article: http://www.haskell.org/haskellwiki/Smart_constructors Thanks Neil -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PRO

RE: [Haskell-cafe] Constraints at construction

2008-10-09 Thread Mitchell, Neil
Hi Iain, The wiki page has quite a nice article: http://www.haskell.org/haskellwiki/Smart_constructors Thanks Neil > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Iain Barnett > Sent: 09 October 2008 2:03 pm > To: haskell-cafe@haskell.org > Subje