
28 Dec
2008
28 Dec
'08
4:08 p.m.
type Coordinate = (RInt,RInt) data RInt = Zero | One | Two | Three | Four | Five | Six | Seven | Eight | Nine | Ten | Eleven You might also want to add an instance of Num so that you can define them simply by typing the relevant number, but then you'll lose the type system checking the bounds. Bob On 28 Dec 2008, at 10:07, Colin Paul Adams wrote:
Hello,
I want to declare a type thus:
type Coordinate = (Int, Int)
But the two integers must be confined to the inclusive range 0-11. Can i express that in the type system? -- Colin Adams Preston Lancashire _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners