Re: [Haskell-cafe] Foralls in records

2007-03-13 Thread Matthew Brecknell
Adde: > data TransactionT = forall c. (Connection c) => TransactionT c > > data Transaction a = Transaction (TransactionT -> (a, TransactionT)) > > getConnection :: Transaction c > getConnection = Transaction (\t@(TransactionT c) -> (c, t)) > > class Connection c where > connectionExecute :: c

[Haskell-cafe] Foralls in records

2007-03-13 Thread Adde
Hi. I'm experimenting with implementing database transactions as monads but I'm getting stuck on how to store a generic connection (only constrained by a typeclass) inside the transaction. The reason I'm doing it this way is that the connection could be a different kind of structure depending on