On Thu, Jul 22, 2004 at 06:28:51PM +0200, Pierre Weis wrote:
> > A more lightweight notation would be needed in order to do real lazy
> > programming in ocaml. At that time I wondered if specifiying the
> > lazyness when one defines the function and not when one uses it would
> > be a problem (I mean a technical problem, not an ideological one).
> > For example if one defines
> >
> > let f (lazy x) = ...
> >
> > then the application f (x + y) would implicitely mean f (lazy (x + y)).
>
> [...]
>
> This has to be precisely ruled out and the necessary proofs have to be
> made, but I think it could work (including for higher-order
> functional, map, fold, and so on). I mean, I don't see any trivial
> counter-example that would ruin this scheme. Wao! If this rule
> turned out to be usable, it would be a major improvement for lazy
> evaluation in our favorite language.
This is reminiscent of the notation in Wadler's paper, "How to add laziness
to a strict language, without even being odd"[1]. He even gives the
semantics as a translation into the delay/force ("odd") style already
supported in O'Caml, similar to this proposal. Perhaps it could even be
implemented in camlp4, without any need for type-based transformations.
William
[1] http://homepages.inf.ed.ac.uk/wadler/papers/lazyinstrict/lazyinstrict.txt
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners