I have a Transaction monad that looks like this:
newtype Transaction t m a = .. my monad stack here ..
t is the type of phantom that I use to make sure that the transactions I connect belong to the same file storage.
In my main loop iteration, a type type is used:
Transaction DB IO (Widget (Transaction DB IO ()))
The above type means: "a transaction that generates a user interface widget whose user inputs are converted to transactions for execution."
In addition, I have:
data Property m a = Property { get :: m a, set :: a -> m () }
which is extremely useful (especially because of its ability to link with FCLabels.
I make a lot of use Property (Transaction t m)to create my transactions.
, , , , , , , .
-, phantom, :
Transaction ReadOnly Transaction ReadWrite . , , .
, , /, "m" ReadWrite. -, .
, .