Hello Daniel and all,<div><br></div><div>Your suggestion #1 : Can&#39;t import Database.HDBC.MySQL.Connection :<br><br><font class="Apple-style-span" face="&#39;courier new&#39;, 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&#39;:<br>      it is a hidden module in the package `HDBC-mysql-0.6&#39;<br>      Use -v to see a list of the files searched for.<br>Failed, modules loaded: none.<br>
Prelude&gt;<br>Leaving GHCi.</font><br><br></div><div>Your suggestion #2 : Unfortunately, the type isn&#39;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 &#39;connectMySQL&#39; method to create an<br>@Database.HDBC.IConnection@ that you can use to interact with a MySQL<br>database.  Use the &#39;defaultMySQLConnectInfo&#39;, overriding the default<br>
values as necessary.</i><br><br>so I tried :<div><br><div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">connecter :: IO IConnection</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">connecter = connectMySQL mysqlInfo</font></div>
<div><br></div></div><div>But then that didn&#39;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="&#39;courier new&#39;, monospace">connecter :: IConnection conn =&gt; conn</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">connecter = connectMySQL mysqlInfo</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;"><br></font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif">And even though I suspect that&#39;s the correct type, it fails too :</font></div>
<div><br></div><div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">david@pcdavid2:~/projets/haskell/caimonitor$ ghci -Wall Bdd.hs</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, 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="&#39;courier new&#39;, monospace">Loading package ghc-prim ... linking ... done.</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">Loading package integer ... linking ... done.</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">Loading package base ... linking ... done.</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">[2 of 2] Compiling Bdd              ( Bdd.hs, interpreted )</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace"><br></font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">Bdd.hs:27:12:</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">    Couldn&#39;t match expected type `conn&#39;</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">           against inferred type `HDBC-mysql-0.6:Database.HDBC.MySQL.Connection.Connection&#39;</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">      `conn&#39; is a rigid type variable bound by</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">             the type signature for `connecter&#39; at Bdd.hs:26:25</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">      Expected type: IO conn</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">      Inferred type: IO</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">                       HDBC-mysql-0.6:Database.HDBC.MySQL.Connection.Connection</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">    In the expression: connectMySQL mysqlInfo</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">    In the definition of `connecter&#39;:</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, 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&#39;t exported.</div>
</div><div><br>For now, I&#39;ve disabled that type of warnings.</div><div><br></div><div>Thanks,</div><div><br></div><div>David.</div></div></div>