
1 Sep
2008
1 Sep
'08
5:47 a.m.
Lets imagine I want a type for a point like: type Point = (Int, Int) But what, if I can predict that the X and Y values are in a range between 0 and 100?
1. this only works with "dependent types", which Haskell does not have - by design (type inference/checking would be undecidable). It works in Coq, PVS etc. but there the programmer has to help the type checker (i.e. attach a proof that the type is correct) 2. using "type" (instead of "data") is generally a bad idea. J.W.