mediachain / L-SPACE

[DEPRECATED] Books = Knowledge = Power = (Mass x Distance^2) / Time^3
MIT License
9 stars 1 forks source link

Use free monad for transactions #34

Closed yusefnapora closed 8 years ago

yusefnapora commented 8 years ago

This is based on the example in this article: https://www.chrisstucchio.com/blog/2015/free_monads_in_scalaz.html

I like it overall, since it seems like a nice way to bundle up operations that depend on each other without needing nested transactions (which gremlin doesn't support).

Something I'd like, but can't figure out how to implement, is to have the type parameter of GraphOp be an Xor[GraphError, A], instead of just A, and fail the transaction if the op returns an error. As it is, the GraphOp need to throw an exception to bail out, which seems not so great.

parkan commented 8 years ago

Putting this on hold, correct?