Browse thread
ambitious proposal: polymorphic arithmetics
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Eijiro Sumii <eijiro_sumii@a...> |
| Subject: | ambitious proposal: polymorphic arithmetics |
Hi once again, Well, I asked the same question many years ago, but I'm afraid I didn't receive satisfactory answers at that time, perhaps because I was just a nameless student.:-) Now that my colleagues and I won the ICFP programming contest twice (as well as organizing it once) and published two POPL papers, I dare to raise the same question again, hoping I'll receive more reasonable responses this time...;-) So here it goes: why don't we have polymorphic +, -, etc. while we have polymorphic =, <, etc.? Many novices and (at least) some experts feel that +., -., etc. are not quite nice. Why not define +, -, etc. for as many types as possible such as integers, floating-point numbers, and tuples? I think they can be implemented almost in the same efficient way as =. They can also raise an exception if applied to unsupported values such as functions, just as = does. P.S. I believe I'm not proposing anything as serious as Haskell type classes. -- Eijiro Sumii (http://www.cis.upenn.edu/~sumii/) Department of Computer and Information Science, University of Pennsylvania