Hello,
I am pretty new to Haskell but I feel like I have a decent understanding over all.
I'm currently trying to play with the unofficial mongoDB bindings for haskell.
If you look at the code here: http://github.com/srp/mongoDB/blob/master/Database/MongoDB.hs
connect :: HostName -> [ConnectOpt] -> IO Connection
connect = flip connectOnPort (Network.PortNumber 27017)
As you can see this methods returns/resolves to an IO Connection.
However all methods that actually interract with the database take a just plain Connection as an argument. Ex:
disconnect :: Connection -> IO ()
disconnect = conClose
I think there is something fundamental I'm not understanding here, maybe the IO has to do with it being part of the IO Monad? I'm really pretty clueless and was wondering if anyone has any light to shed on this for me.
How can I coax a IO Connection to a Connection in the mongoDB bindings?
Thanks for any input you may have.