Standard ML of New Jersey


The SUSP signature


Synopsis

signature SUSP
structure Susp : SUSP

This module creates and manipulates suspensions for lazy evaluation.


Interface

type 'a susp
val delay : (unit -> 'a) -> 'a susp
val force : 'a susp -> 'a

Description

type 'a susp

delay f
Make a suspension from function f.

force s
If s has never been forced before, evaluate its underlying f function, save the result, and return the result. If s has been previously forced, return the result from last time.



[ Top | Parent | Contents | Index | Root ]

Last Modified October 28, 1997
Comments to sml-nj@research.bell-labs.com
Copyright © 1998 Bell Labs, Lucent Technologies