English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
RE: [Caml-list] Operator overloading
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-03-09 (09:32)
From: Tom <tom.primozic@g...>
Subject: Re: [Caml-list] Operator overloading
On 09/03/07, skaller <skaller@users.sourceforge.net> wrote:
> Actually, length can be defined in turns of fold:
> let len x = fold (fun acc elt -> acc + 1) 0 container

Yes, as long as x is a container. But how are you going to define a length
of a snake using fold?

Basically, I agree with you. I'm just saying that you can further increase
the "typeclass" of length-able objects to almost anything. Why limit

- Tom