1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
2
"http://www.w3.org/TR/REC-html40/loose.dtd">
5
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6
<META name="GENERATOR" content="hevea 1.05">
8
Module Lazy: deferred computations.
11
<BODY TEXT=black BGCOLOR=white>
12
<A HREF="manual045.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
13
<A HREF="manual032.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A>
14
<A HREF="manual047.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
16
<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%">
17
<TR><TD BGCOLOR="#66ff66"><DIV ALIGN=center><TABLE>
18
<TR><TD><B><FONT SIZE=5>19.14</FONT></B></TD>
19
<TD WIDTH="100%" ALIGN=center><B><FONT SIZE=5> Module </FONT></B><B><FONT SIZE=5><TT>Lazy</TT></FONT></B><B><FONT SIZE=5>: deferred computations.</FONT></B></TD>
20
</TR></TABLE></DIV></TD>
23
<A NAME="@manual416"></A><BR>
26
| Delayed of (unit -> 'a)
30
type 'a t = 'a status ref;;
32
A value of type <CODE>'a Lazy.t</CODE> is a deferred computation (also called a
33
suspension) that computes a result of type <CODE>'a</CODE>. The expression
34
<CODE>lazy (expr)</CODE> returns a suspension that computes <CODE>expr</CODE>.</BLOCKQUOTE>
37
val force: 'a t -> 'a;;
38
</PRE><A NAME="@manual417"></A><A NAME="@manual418"></A><BLOCKQUOTE>
39
<CODE>Lazy.force x</CODE> computes the suspension <CODE>x</CODE> and returns its result.
40
If the suspension was already computed, <CODE>Lazy.force x</CODE> returns the
41
same value again. If it raised an exception, the same exception is
43
Raise <CODE>Undefined</CODE> if the evaluation of the suspension requires its
44
own result.</BLOCKQUOTE>
47
<A HREF="manual045.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
48
<A HREF="manual032.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A>
49
<A HREF="manual047.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>