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
[Caml-list] Understanding why Ocaml doesn't support operator overloading.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Remi VANICAT <vanicat@l...>
Subject: Re: [Caml-list] Understanding why Ocaml doesn't support operator overloading.
William Lovas <> writes:

> Mmm, this certainly is a useful use of polymorphism without parametrized,
> types, but the challenge i was trying to propose was more to the spirit of
> the original 'a -> 'a theorem: by "useful function that operates on just
> 'a's", what i meant was essentially "a non-trivial function of type
> 'a -> 'a", which is (i hope) a significantly more difficult challenge :)
> Polymorphism as used in `raise' and `ignore' strikes me as more language
> magic than anything else -- although useful in practice, i have a strong
> intuition that from a certain theoretical perspective, namely that of
> purely functional languages, they're not so interesting.  So, to clarify,
> while they are practical uses of polymorphism, they're not what i had in
> mind when i wrote the above paragraph.

Well, the ignore function is just an example of a constant function,
that may be of some interest in some case. The raise function is more
complex as it use exception that are a difficult matter in purely
functional languages. But I remember to have seen a try to add
exception to Haskell, so there might be intersting too.
Rémi Vanicat
To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: