Frege is a Haskell for the JVM and can as such support STM with all the benefits of a purely functional language. In particular, Frege guarantees through the type system that no transactional variable (TVar) can be accessed outside a transaction and no side effect can happen inside a transaction.