Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
ambitious proposal: polymorphic arithmetics
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-04-06 (15:15)
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

Eijiro Sumii (
Department of Computer and Information Science, University of Pennsylvania