06 Jun 2002 00:04:16 +0100
I remain puzzled by the thrust of your argument however one bit did
> Also a function working over (Int,Int) will do so even if the
> numbers are totally irrelevant to that function. They maybe the
> number of (apples,oranges) or number of (books,authors).
It sounds like you want dimension types. In their original form,
dimension types were concerned with physical dimensions like metres
and time and combinations like metres per second per second. As I
understand it we've now progressed to the point where we can talk
about functions which do things like taking values of type 'books per
second' and 'books per author' and returning 'authors per second' (or
something like that).
Anyway, dimension types have been studied by Andrew Kennedy
(and others) and can be encoded in HM(X)
a very researchy extension of Haskell's type classes.
Alastair Reid email@example.com http://www.cs.utah.edu/~reid/