[PRL] accumulator style

Matthias Felleisen matthias at ccs.neu.edu
Tue Sep 20 16:12:47 EDT 2005


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 




More information about the PRL mailing list