examples icon indicating copy to clipboard operation
examples copied to clipboard

Is it really STM?

Open graninas opened this issue 7 years ago • 3 comments

https://github.com/tpolecat/examples/blob/ab444af9101b9049d6bd7ebf13ae583bc77ac60a/src/main/scala/eg/FreeSTM.scala#L10

Hello, I'm curious if this is actually a real STM. I see atomic evaluation, but I don't see conflicts resolving. Not sure if the behavior of real STM holds here. Could you please clarify?

I found the same approach to STM with Free monads independently and then googled your code, but my STM follows the straightforward definition of STM and thus can be considered well-behaving:

https://github.com/graninas/stm-free

Also, it differs from other STMs by declaring a context explicitly. This is good because many optimizations can utilize some additional knowledge came with different contexts. Also, you can have separate "clusters" of independent STM models.

I'm still working on the library, so you might find it not that rich and mature as original Haskell's STM.

graninas avatar May 04 '18 19:05 graninas

Ok, disregard. It seems you just wrapped Scala STM into free monad interface.

graninas avatar May 07 '18 07:05 graninas

Did you know the answer after 2 years?

ghost avatar Sep 13 '20 02:09 ghost

@asimo10 Me? I don't think so...

graninas avatar Sep 13 '20 06:09 graninas