Article View: comp.lang.functional
Article #636Re: Unique types etc.
From: Leon Pillich
Date: Sat, 03 Oct 1992 17:24
Date: Sat, 03 Oct 1992 17:24
32 lines
1785 bytes
1785 bytes
In <1992Oct2.170149.24827@plex-1.ann-arbor.mi.us> dhw@plex-1.ann-arbor.mi.us (David West) writes:
>In article <BvG3I3.B2M@sci.kun.nl> leonp@cs.kun.nl (Leon Pillich) writes:
>>We should rewrite G as:
>>:: G Clock -> ....
>> G clock -> ..... time1 ..... time2,
>> (clock', time1): GetTime clock,
>> (clock'', time2): GetTime clock';
>>
>>We now have time1 and time2 with the correct values, yet it remains
>>referentially transparent and therefore functional.
>Don't you need to somehow make clock'' available for the next invocation
>of GetTime anywhere, even within G? Or have I misunderstood how this is
>supposed to work?
Sure, but only whenever you will need it again.
But indeed normally you would write such programs like
- first initialize a unq type i.e. Open a UNQ file, clock etc
- a cascade of functions each having the unq type as input
and the again as output
- when thers no need anymore of the type just discard it
Thats all to it....
Leon Pillich
University of Nijmegen, Holland
email: leonp@cs.kun.nl
-------------------------------------------------------------
Life is what's happening when you're making other plans ...
John Lennon
Technical Details
Message-ID:
<BvK304.A2s@sci.kun.nl>Path:
arc1-ca.pugleaf.net!sparky!uunet!gatech!darwin.sura.net!Sirius.dfn.de!dct.zrz.tu-berlin.de!news.netmbx.de!Germany.EU.net!mcsun!sun4nl!wn1.sci.kun.nl!cs.kun.nl!leonpReferences:
<BvG3I3.B2M@sci.kun.nl> <1992Oct2.170149.24827@plex-1.ann-arbor.mi.us>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.functional Path: arc1-ca.pugleaf.net!sparky!uunet!gatech!darwin.sura.net!Sirius.dfn.de!dct.zrz.tu-berlin.de!news.netmbx.de!Germany.EU.net!mcsun!sun4nl!wn1.sci.kun.nl!cs.kun.nl!leonp From: leonp@cs.kun.nl (Leon Pillich) Subject: Re: Unique types etc. Message-ID: <BvK304.A2s@sci.kun.nl> Sender: news@sci.kun.nl (NUnet News Owner) Organization: University of Nijmegen, The Netherlands References: <BvG3I3.B2M@sci.kun.nl> <1992Oct2.170149.24827@plex-1.ann-arbor.mi.us> Date: Sat, 3 Oct 1992 17:24:03 GMT Lines: 32