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
lazy application to Lazy.t
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-12-07 (21:42)
From: Hal Daume III <hdaume@I...>
Subject: lazy application to Lazy.t
suppose I have

  val x : int ref Lazy.t

and I want to 'incr' it, but want to keep it lazy.  i.e., if i start with:

  let x = Lazy.lazy_from_fun (fun () -> ref 0)

then i run my lazy_incr on it, I want:

  let y = Lazy.force x

to return 1

but i only want 'incr' to be run when I Lazy.force x.  is there a way to 
accomplish this?


 Hal Daume III                                   |
 "Arrest this man, he talks in maths."           |