scheme monads and bind vs compose
- From: sunnanpuppan@xxxxxxxxx
- Date: 21 May 2007 09:15:48 -0700
How do Haskells notions of >>=, run and return map into widespread
scheme constructs like compose, apply and values?
I'm guess I'm looking for a clean, schemish way to deal with monadic
side-effects using existing scheme procedures like delay, force, and
compose. (Am I right in assuming that compose always calls its
arguments rtl since call-with-values needs to extract the values from
the rightmost function application before passing it on, and that
compose is implicitly delayed since a call to compose yields a
procedure, not the results of a procedure application?)
Can Haskells bind be approximated using let* or begin for >> and
function composition (either explicitly or via compose) for >>=? What
are the risks in doing so?
I'm looking at, and grokking (I think), http://okmij.org/ftp/Scheme/monad-in-Scheme.html
and Message-ID: <slrnc3781u.oor.neelk@xxxxxxxxxxxxxxxxxxxx> over in
CLF, both which strikes me as too alien from Scheme; I'd like to use
the general compose instead of >>=, IO->>- and so on.
I've spent the day looking at monads and mostly it seems to me to be
kind of similar to a program I wrote last fall --
http://munnen.handgranat.org/Sunnan/slt.scm (noteably the last line.)
extract and rename have side-effects. Is this a style of programming I
should move from or can it work?
Am I missing something?
Sunnan
.
- Follow-Ups:
- Re: scheme monads and bind vs compose
- From: Joe Marshall
- Re: scheme monads and bind vs compose
- Prev by Date: Revision control system Scheme interface
- Next by Date: Re: Vote on R6RS, if you have the time to write a 150-word essay
- Previous by thread: Revision control system Scheme interface
- Next by thread: Re: scheme monads and bind vs compose
- Index(es):
Relevant Pages
|
Loading