type equivalency

Alastair Reid reid@cs.utah.edu
06 Jun 2002 00:04:16 +0100


I remain puzzled by the thrust of your argument however one bit did
make sense:

> 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 

  http://research.microsoft.com/users/akenn/

(and others) and can be encoded in HM(X) 

  http://www.cs.mu.oz.au/~sulzmann/projects.html

a very researchy extension of Haskell's type classes.


-- 
Alastair Reid        reid@cs.utah.edu        http://www.cs.utah.edu/~reid/