Re: [Haskell-cafe] Creating a type for a subset of the integers

2007-12-20 Thread Brad Larsen
On Wed, 19 Dec 2007 02:00:53 -0500, Jules Bean [EMAIL PROTECTED] wrote: Brad Larsen wrote: Hi there list, How would one go about creating a new type for a subset of the integers, for (contrived) example just the even integers? I was thinking of making a new type newtype EvenInt =

Re: [Haskell-cafe] Creating a type for a subset of the integers

2007-12-20 Thread Jules Bean
Brad Larsen wrote: On Wed, 19 Dec 2007 02:00:53 -0500, Jules Bean [EMAIL PROTECTED] wrote: Brad Larsen wrote: Hi there list, How would one go about creating a new type for a subset of the integers, for (contrived) example just the even integers? I was thinking of making a new type

Re: [Haskell-cafe] Creating a type for a subset of the integers

2007-12-19 Thread Derek Elkins
On Tue, 2007-12-18 at 23:04 -0800, Don Stewart wrote: jules: Brad Larsen wrote: Hi there list, How would one go about creating a new type for a subset of the integers, for (contrived) example just the even integers? I was thinking of making a new type newtype EvenInt =

[Haskell-cafe] Creating a type for a subset of the integers

2007-12-18 Thread Brad Larsen
Hi there list, How would one go about creating a new type for a subset of the integers, for (contrived) example just the even integers? I was thinking of making a new type newtype EvenInt = EvenInt Integer but the problem with this is that it accepts any integer, even odd ones. So to

Re: [Haskell-cafe] Creating a type for a subset of the integers

2007-12-18 Thread gwern0
On 2007.12.18 21:07:25 -0500, Brad Larsen [EMAIL PROTECTED] scribbled 0.6K characters: Hi there list, How would one go about creating a new type for a subset of the integers, for (contrived) example just the even integers? I was thinking of making a new type newtype EvenInt = EvenInt

Re: [Haskell-cafe] Creating a type for a subset of the integers

2007-12-18 Thread Jules Bean
Brad Larsen wrote: Hi there list, How would one go about creating a new type for a subset of the integers, for (contrived) example just the even integers? I was thinking of making a new type newtype EvenInt = EvenInt Integer but the problem with this is that it accepts any integer, even