[PRL] accumulator style

Mitchell Wand wand at ccs.neu.edu
Tue Sep 20 16:29:03 EDT 2005


[2nd transmission, to go to PRL mailing list]

If you curry out the accumulator parameter, it looks a lot like the 
state monad.  But it all depends on what you are doing with the 
accumulator along the way.  For example, figures 90 and 92 use the 
accumulator in quite different ways.

Part of the problem is that there are two different monads lurking 
here:  the "accumulator" monad (whatever that is) and the "structure" 
monad (list or tree or whatever), and the interesting part is in how 
they interact.

--Mitch

Matthias Felleisen wrote:

>
> On Sep 20, 2005, at 4:03 PM, Dave Herman wrote:
>
>>> Is accumulator-passing (HtDP Ch. VI) a monad? -- Matthias
>>
>>
>> Well, using an accumulator as an explicit state variable is something 
>> that a state monad would abstract away.
>
>
> My accumulator style is state free.
>
>> But I don't really know what "is X a monad?" means.
>
>
> Moggi claims that monads represent all modes of computation. Since 
> accumulator-style programs are "more expressive" (I offer this w/o 
> definition and proof) than regular recursive programming styles. It 
> requires both the introduction and (partial) weaving of an extra 
> information flow and its exploitation, which makes it look like 
> "monadic mumbo jumbo". At the same time, it doesn't look like a cps 
> conversion at all, so I am wondering whether for any accumulator-style 
> function, there exists a monad such that the monad explains the 
> accumulation via some provable equivalence.
>
> -- Matthias, who, if he knew the answer, wouldn't ask
>
> _______________________________________________
> PRL mailing list
> PRL at lists.ccs.neu.edu
> https://lists.ccs.neu.edu/bin/listinfo/prl

-------------- next part --------------
HTML attachment scrubbed and removed


More information about the PRL mailing list