Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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
ourselves?

- Tom