Version franaise
Home About Download Resources Contact us
Browse thread
The Implicit Accumulator: a design pattern using optional arguments
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Dirk Thierbach <dthierbach@g...>
Subject: Re: [Caml-list] The Implicit Accumulator: a design pattern using optional arguments
Thomas Fischbacher wrote:
> Dirk Thierbach wrote:

>>>> Pass the stack as an argument to those functions that need it.

>> So could one "hide the plumbing" in a monad?

> Hmmm. In principle, yes. I think that should be possible here.
> (Done this for a related problem where contextual typesetting
> information is passed around.)

And I think it has the additional advantage that deallocation is safe,
because the typesystem guarantees that no reference to the stack(s)
can escape the monad.

It's more or less just a variation of the state monad.

- Dirk