selectel / mongoDB-haskell

MongoDB driver for Haskell
http://hackage.haskell.org/package/mongoDB
Apache License 2.0
21 stars 11 forks source link

Docs and examples contain outdated references to runIOE #27

Open btubbs opened 10 years ago

btubbs commented 10 years ago

runIOE is all over the docs, examples, and comments, but no longer in the code. As someone new to this library, and still fairly new to Haskell, this leads to a lot of frustration.

If you can show me the new recommended way to make a connection, I'll grep through the codebase, update the examples, and send a pull request.

dschalk commented 9 years ago

As you probably discovered, "runIOE" was still present in the final version mongoDB 1 (the "1" series ended with version "1.5"), but was gone in version "2.0" and hasn't reappeared. Hackage stated its type as "runIOE :: ErrorT IOError IO a -> IO aSource" and commented, :"Run action while catching explicit error and rethrowing in IO monad."

I am experimenting with mongoDB this week and I haven't encountered any problems with the published examples when I just leave out "runIOE"; for example, by changing "pipe <- runIOE $ connect $ . . ." to "pipe <- connect $ . . ."

I doubt that there is a new recommended way to make a connection. I don't think that "runIOE" was ever declared to be deprecated. Updating the examples to make them compileable would be a valuable contribution to the Haskell community. People who are curious about Haskell aren't likely to study code that doesn't run, or to stick with a language whose ecosphere is so littered with example code that doesn't work. I'll raise the issue of the non-compiling tutorial code at mongodb/mongoDB-haskell on Github. Somebody should tell the author of Haskell Data Analysis Cookbook that he got blindsided by the change, and his book went to press with a dud mongodb example.