Version française
Home     About     Download     Resources     Contact us    
Browse thread
functions' recursive construction
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jon Harrop <jon@f...>
Subject: Re: [Caml-list] functions' recursive construction
On Wednesday 23 May 2007 00:32:58 you wrote:
> On 5/23/07, Lukasz Stafiniak <lukstafi@gmail.com> wrote:
> > On 5/23/07, Jon Harrop <jon@ffconsultancy.com> wrote:
> > > What would the type of "f" be?
> >
> >  'a -> 'a as 'a
>
> I'm sorry, I meant:
> #     val f : int -> ('a -> 'a as 'a) = <fun>

Not this then:

# let rec f n x = if n=0 then x else f (n-1) (x x);;
val f : int -> ('a -> 'a as 'a) -> 'a = <fun>

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
The F#.NET Journal
http://www.ffconsultancy.com/products/fsharp_journal/?e