[Haskell-cafe] Are casts required?

2011-06-06 Thread Patrick Browne
Are casts required to run the code below? If so why? Thanks, Pat -- Idetifiers for objects class (Integral i) = IDs i where startId :: i newId :: i - i newId i = succ i sameId, notSameId :: i - i - Bool -- Assertion is not easily expressible in Haskell -- notSameId i newId i = True sameId

Re: [Haskell-cafe] Are casts required?

2011-06-06 Thread Ryan Ingram
I always forget to reply all. Silly gmail. On Mon, Jun 6, 2011 at 2:07 AM, Ryan Ingram ryani.s...@gmail.com wrote: Hi Pat. There aren't any casts in that code. There are type annotations, but this is different than the idea of a cast like in C. For example ((3 :: Integer) :: Int) is

Re: [Haskell-cafe] Are casts required?

2011-06-06 Thread Daniel Fischer
On Montag, 6. Juni 2011, 09:45, Patrick Browne wrote: Are casts required to run the code below? If so why? Thanks, Pat -- Idetifiers for objects class (Integral i) = IDs i where startId :: i newId :: i - i newId i = succ i sameId, notSameId :: i - i - Bool -- Assertion is not

Re: [Haskell-cafe] Are casts required?

2011-06-06 Thread Steffen Schuldenzucker
Hi Patrick, On 06/06/2011 09:45 AM, Patrick Browne wrote: Are casts required to run the code below? If so why? Thanks, Pat -- Idetifiers for objects class (Integral i) = IDs i where startId :: i newId :: i - i newId i = succ i sameId, notSameId :: i - i - Bool -- Assertion is not

Re: [Haskell-cafe] Are casts required?

2011-06-06 Thread Daniel Fischer
On Montag, 6. Juni 2011, 11:08, Ryan Ingram wrote: Hi Pat. There aren't any casts in that code. There are type annotations, but this is different than the idea of a cast like in C. For example ((3 :: Integer) :: Int) is a compile error. What you are seeing is that 3 has