Takusen and iteratee problem

Hello Cafe. Today I stuck with the following problem: I want to read a file with iteratee package, and but it to database through Takusen package, but it doesn't work. The `Takusen` was built with `mtl` package, and `iteratee` - with `transformers`, so they are conflicting when used simultaneously. To be concrete, I want to run the code, that looks like: withSession (connect "dbname.db") (do execDDL (sql "create table x (value string)") fillFromFile "file.dat" ) fillFromFile fname = fileDriverFd iter fname iter = iterator that uses execDML (sql "Insert into ...." ).... I have no ideas how to solve the problem, so appreciate any recommendations, that will make it possible. Thanks, Vasyl

On Fri, Mar 19, 2010 at 2:17 PM, Vasyl Pasternak
Hello Cafe.
Today I stuck with the following problem: I want to read a file with iteratee package, and but it to database through Takusen package, but it doesn't work. The `Takusen` was built with `mtl` package, and `iteratee` - with `transformers`, so they are conflicting when used simultaneously.
To be concrete, I want to run the code, that looks like:
withSession (connect "dbname.db") (do execDDL (sql "create table x (value string)") fillFromFile "file.dat" )
fillFromFile fname = fileDriverFd iter fname
iter = iterator that uses execDML (sql "Insert into ...." )....
I have no ideas how to solve the problem, so appreciate any recommendations, that will make it possible.
I'm a bit of a Takusen newbie, but I've been maintaining some code recently that makes use of it. I've coded up some trivial examples using the iteratees package. Based on my very shallow understanding, I think the problem is just that both packages define iteratees but differently. Assuming that's correct, then I think you need a way to transform between the two types of iteratees. Perhaps that can be done with an enumerator that fetches values from your fillFromFile iteratee and turns that into the type of iteratee that Takusen uses? Jason

Today I stuck with the following problem: I want to read a file with iteratee package, and but it to database through Takusen package, but it doesn't work. The `Takusen` was built with `mtl` package, and `iteratee` - with `transformers`, so they are conflicting when used simultaneously.
And what error message is displayed? -- vvv

Hi, seems, that I found how to solve it. I replased `mtl` dependency
with `transformers` and `monads-fd` and everything works fine.
BTW. Iteratee and Takusen didn't want to work because of different
instances of MonadIO (Iteratee needs MonadIO from transformers
package, but Takusen implements MonadIO from mtl)
Regards,
Vasyl
2010/3/20 Valery V. Vorotyntsev
Today I stuck with the following problem: I want to read a file with iteratee package, and but it to database through Takusen package, but it doesn't work. The `Takusen` was built with `mtl` package, and `iteratee` - with `transformers`, so they are conflicting when used simultaneously.
And what error message is displayed?
-- vvv
participants (3)
-
Jason Dagit
-
Valery V. Vorotyntsev
-
Vasyl Pasternak