Hello Daniel and all,<div><br></div><div>Your suggestion #1 : Can't import Database.HDBC.MySQL.Connection :<br><br><font class="Apple-style-span" face="'courier new', monospace">david@pcdavid2:~/projets/haskell/caimonitor$ ghci -Wall Bdd.hs<br>
GHCi, version 6.10.3: <a href="http://www.haskell.org/ghc/">http://www.haskell.org/ghc/</a> :? for help<br>Loading package ghc-prim ... linking ... done.<br>Loading package integer ... linking ... done.<br>Loading package base ... linking ... done.<br>
<br>Bdd.hs:15:7:<br> Could not find module `Database.HDBC.MySQL.Connection':<br> it is a hidden module in the package `HDBC-mysql-0.6'<br> Use -v to see a list of the files searched for.<br>Failed, modules loaded: none.<br>
Prelude><br>Leaving GHCi.</font><br><br></div><div>Your suggestion #2 : Unfortunately, the type isn't exported, as it seems :</div><div><br>The doc says :<br><br><i>This module provides a MySQL driver for the HDBC database interface.<br>
To use it, invoke the 'connectMySQL' method to create an<br>@Database.HDBC.IConnection@ that you can use to interact with a MySQL<br>database. Use the 'defaultMySQLConnectInfo', overriding the default<br>
values as necessary.</i><br><br>so I tried :<div><br><div><div><font class="Apple-style-span" face="'courier new', monospace">connecter :: IO IConnection</font></div><div><font class="Apple-style-span" face="'courier new', monospace">connecter = connectMySQL mysqlInfo</font></div>
<div><br></div></div><div>But then that didn't work too, because IConnection is a class, not a type ( which is not obvious from the documentation snippet I read)</div><div><br></div><div>So then I tried :<br><br></div>
<div><div><font class="Apple-style-span" face="'courier new', monospace">connecter :: IConnection conn => conn</font></div><div><font class="Apple-style-span" face="'courier new', monospace">connecter = connectMySQL mysqlInfo</font></div>
<div><font class="Apple-style-span" face="'courier new'"><br></font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif">And even though I suspect that's the correct type, it fails too :</font></div>
<div><br></div><div><div><font class="Apple-style-span" face="'courier new', monospace">david@pcdavid2:~/projets/haskell/caimonitor$ ghci -Wall Bdd.hs</font></div><div><font class="Apple-style-span" face="'courier new', monospace">GHCi, version 6.10.3: <a href="http://www.haskell.org/ghc/">http://www.haskell.org/ghc/</a> :? for help</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">Loading package ghc-prim ... linking ... done.</font></div><div><font class="Apple-style-span" face="'courier new', monospace">Loading package integer ... linking ... done.</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">Loading package base ... linking ... done.</font></div><div><font class="Apple-style-span" face="'courier new', monospace">[2 of 2] Compiling Bdd ( Bdd.hs, interpreted )</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace">Bdd.hs:27:12:</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> Couldn't match expected type `conn'</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> against inferred type `HDBC-mysql-0.6:Database.HDBC.MySQL.Connection.Connection'</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> `conn' is a rigid type variable bound by</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> the type signature for `connecter' at Bdd.hs:26:25</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> Expected type: IO conn</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> Inferred type: IO</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> HDBC-mysql-0.6:Database.HDBC.MySQL.Connection.Connection</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> In the expression: connectMySQL mysqlInfo</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> In the definition of `connecter':</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> connecter = connectMySQL mysqlInfo</font></div><div><br></div></div><div>I looked at Connection.hsc from the library and the Connection type defined there isn't exported.</div>
</div><div><br>For now, I've disabled that type of warnings.</div><div><br></div><div>Thanks,</div><div><br></div><div>David.</div></div></div>