🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.functional
Article #703

Lazy constructors(Was: Re: Intermediate Codes for Functional Languages)

#703
From: Wolfgang Grieskamp
Date: Mon, 17 Dec 1990 01:08
49 lines
2672 bytes
fs@rex.cs.tulane.edu (Frank Silbermann) writes:

   >[...]
   >But how can one speak of strict or lazy constructors?
   >Consider for example, the ordered pair constructor,
   >which uses elements X1 and X2 of domains D1 and D2,
   >to create the element <X1,X2> of domain D1xD2.
   >The standard selector functions will choose
   >the appropriate piece of <X1,X2> regardless
   >of whether the other side happens to be the bottom.

   >Of course, the language designer may choose to deny the programmer
   >direct access to the standard selector functions,
   >and instead provide selector functions which,
   >before selecting an element, verify that both sides
   >are strictly above bottom.  In any case,
   >the elements <X1,bot>, <bot,X2> and <bot,bot> are
   >distinct elements of D1xD2, regardless of whether
   >any particular language lets the programmer make use of this fact.

   >So, when we speak of strict constructors, are we not _really_
   >describing a property of the _selector_ functions, and not the constructor?
   >Or, is there another version of domain theory I am not aware of?

I'am not a HOPE expert (which modells lazy constructors), but as i know 
the equations will hold:

	fst(<X,bot>) = X
	snd(<bot,X>) = X

i.e. selectors dont force the product to be defined on both sides. 


What you said, however, perfectly holds for STREAMS, which are _not_ an
equivalent of lazy constructors. Streams will satisfy the equations:

	fst(<bot,...>) 	= bot
	rst(<bot,...>) 	= bot	-- rst means "rest" and yields a stream
	fst(<X,...>)   	= X
	rst(<X,...>) 	= <...>

In a language with streams, you can have bottom elements in streams, but you
cannot read over bottom. If you think of streams as communication channels,
this is quite natural, since you dont receive "suspensions" from the 
communication counterpart, but values one by one.

--
Wolfgang Grieskamp 
wg@opal.cs.tu-berlin.de tub!tubopal!wg wg%opal@DB0TUI11.BITNET
Technical Details
Message-ID: <2369@opal.cs.tu-berlin.de>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!sol.ctr.columbia.edu!ira.uka.de!fauern!opal!wg
References: <3054@skye.cs.ed.ac.uk> <7185@vanuata.cs.glasgow.ac.uk> <1975@m1.cs.man.ac.uk> <5455@rex.cs.tulane.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!sol.ctr.columbia.edu!ira.uka.de!fauern!opal!wg
From: wg@opal.cs.tu-berlin.de (Wolfgang Grieskamp)
Newsgroups: comp.lang.functional
Subject: Lazy constructors(Was: Re: Intermediate Codes for Functional Languages)
Message-ID: <2369@opal.cs.tu-berlin.de>
Date: 17 Dec 90 01:08:07 GMT
References: <3054@skye.cs.ed.ac.uk> <7185@vanuata.cs.glasgow.ac.uk> <1975@m1.cs.man.ac.uk> <5455@rex.cs.tulane.edu>
Sender: news@opal.cs.tu-berlin.de
Reply-To: wg@opal.cs.tu-berlin.de
Followup-To: comp.lang.functional
Organization: Technical University of Berlin
Lines: 49
Nntp-Posting-Host: troll.cs.tu-berlin.de