From 41542591768c00d3a395a458739739ad2dcbea59 Mon Sep 17 00:00:00 2001 From: Chris Barker Date: Tue, 7 Dec 2010 13:06:08 -0500 Subject: [PATCH] edit --- assignment9.mdwn | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/assignment9.mdwn b/assignment9.mdwn index f476ab73..bb15aab1 100644 --- a/assignment9.mdwn +++ b/assignment9.mdwn @@ -104,9 +104,9 @@ class notes for [[week6]] on thunks, as well as [[assignment5]]). There is a special stream called `End` that represents a stream that contains no (more) elements, analogous to the empty list `[]`. -Streams that are not empty contain a first object paired with a +Streams that are not empty contain a first object, paired with a thunked stream representing the rest of the series. In order to get -access to the next element in the stream, we must forced the thunk by +access to the next element in the stream, we must *force* the thunk by applying it to the unit. Watch the behavior of this stream in detail. This stream delivers the natural numbers, in order: 1, 2, 3, ... @@ -122,10 +122,10 @@ val tail : unit -> int stream = (* Tail: a thunk *) (* Force the thunk to compute the second element *) # tail ();; -- : int stream = Next (2, [fun]) +- : int stream = Next (2, [fun]) (* Second element: 2 *) # match tail () with Next (_, rest) -> rest ();; -- : int stream = Next (3, ) +- : int stream = Next (3, ) (* Third element: 3 *) You can think of `int_stream` as a functional object that provides -- 2.11.0