[Ur] stateful structure?

Gergely Buday gbuday at gmail.com
Thu Nov 3 05:27:12 EDT 2011


Marc wrote:

> You want this interface instead:
>
> structure Stateful =
> struct
>  val init : {} -> transaction counter_id
>  val increment : counter_id -> transaction xbody
> end
>
> There is no big difference whether you pass a counter_id or the counter
> value. Thus you can use the state monad way:

Ok, but there is another problem here. How can I refer from an
identifier to a value? A handy solution would be a hash table in perl
or an array in other languages, but these are not available in Ur.

- Gergely



More information about the Ur mailing list