От: | palm mute | ||
Дата: | 06.03.07 11:23 | ||
Оценка: | 1 (1) |
val return : 'a -> 'a stm
Primitive to wrap a plain of type 'a value to a 'a stm, which when being executed, will produces the orignal value.
val bind : 'a stm -> ('a -> 'b stm) -> 'b stm
bind t f is a transaction, when executed, first behavior as transaction t, then feed the reture value to f to get the consecutive transaction to execute next.
val (>>=) : 'a stm -> ('a -> 'b stm) -> 'b stm
t >>= f is an alternative notation of bind t f
val (>>) : 'a stm -> 'b stm -> 'b stm
t1 >> t2 is equal to t1 >>= fun _ -> t2 which first execute t1 and wait for its result but ignore it, and then behaviors like t2
...