<div dir="ltr">On Sat, Aug 20, 2011 at 11:01, Henry House <span dir="ltr">&lt;<a href="mailto:hajhouse@hajhouse.org">hajhouse@hajhouse.org</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">&gt; So you want display format data instead of something that you can do<br>
&gt; computations with?  HDBC is giving you the latter; the precision is correct<br>
&gt; for computation, although it could be argued that a Fixed type would be<br>
&gt; better if you intend to propagate exact precision through operations.  (That<br>
&gt; said, I believe Fixed obeys exact mathematical precision instead of<br>
&gt; replicating your SQL backend&#39;s limitations, so you&#39;d be unhappy again in<br>
&gt; case of multiplication or division.)<br>
<br>
</div>No, I want a data type in Haskell that mirrors the data type in the<br>
RDBMS, not conversion of RDBMS fixed-precision data into something else<br>
(Rational). If the data in the RDBMS represented a rational number of<br></blockquote></div><br>OK, so you want my other suggestion (Data.Fixed).  I don&#39;t know how difficult it would be to add support into HDBC, or how many problems you&#39;ll run into using it because other functions you might need are too specialized (that is, you&#39;d need to marshal to/from Rational anyway, or write your own Fixed implementations).  I found it a bit painful last time I used it, but the GHC ecosystem has evolved considerably since then (I was using GHC 6.6).  At least it now has more than just Nano and Pico precisions predefined....<div>
<br>-- <br>brandon s allbery                                      <a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a><br>wandering unix systems administrator (available)     (412) 475-9364 vm/sms<br>
<br>
</div></div>