[Ur] stateful structure?

Gergely Buday gbuday at gmail.com
Wed Nov 2 11:39:52 EDT 2011


Hi there,

is it possible to have a stateful structure in Ur, using the transaction monad?

i.e.

structure Stateful =
struct
  val init : {} -> transaction {}
  val increment : {} -> transaction xbody
end

so that init stores a source int, e.g. source 0, and then increment
gives back an ever increasing integer through the monad on every call.

The key point would be that there is no mention of type int and the
source int in the type of increment.

I wonder if this is possible in the purely functional Ur.

- Gergely



More information about the Ur mailing list