Browse thread
forbidden construct as right hand side of "let rec"
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Mathias Kende <mathias@k...> |
| Subject: | Re: [Caml-list] forbidden construct as right hand side of "let rec" |
On Fri, 23 Oct 2009 00:34:29 +0200, Stéphane Glondu <steph@glondu.net>
wrote:
> Mathias Kende a écrit :
>> let rec g = f g
>
> What about:
>
> let rec g x = f g x
This will compile, but then I also want to write :
let rec h = t (f h)
(with t : ('a -> 'b) -> 'a -> 'b) but here, I can't afford to use
let rec h x = t (f h) x
because t as some side effects and I need it to be evaluated only once.
Any idea on how to do that ?