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
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
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
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
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