<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    This query is regarding <a
href="http://hackage.haskell.org/packages/archive/base/4.6.0.1/doc/html/Foreign-C-Types.html">Foreign.C.Types</a>.<br>
    <br>
    Now that the constructors for CClock, CTime, CUSeconds, and
    CSUSeconds are exposed, it's become clear that these are Ints or
    Words. Technically on some architectures they could be floating
    point, but I would bet that on all architectures that Haskell is
    ever used on, none of these are floating point types. Adding
    Bounded, Enum, Integral, and Bits instances to the "numeric" types
    would break nothing and ease situations such as this:<br>
    <br>
    roundTo :: CTime -&gt; CTime -&gt; CTime<br>
    roundTo a b = (a `div` b) * b<br>
    <br>
    This works right now, but requires a trivial Integral class be
    written for every program that wants to do it.<br>
    <br>
    instance Integral CTime where<br>
    &nbsp; quot (CTime a) (CTime b) = CTime (a `quot` b)<br>
    &nbsp; rem (CTime a) (CTime b) = CTime (a `rem` b)<br>
    &nbsp; div (CTime a) (CTime b) = CTime (a `div` b)<br>
    &nbsp; mod (CTime a) (CTime b) = CTime (a `mod` b)<br>
    &nbsp; quotRem (CTime n) (CTime d) = (\(d,m) -&gt; (CTime d, CTime m))
    (quotRem n d)<br>
    &nbsp; divMod (CTime n) (CTime d) = (\(d,m) -&gt; (CTime d, CTime m))
    (divMod n d)<br>
    &nbsp; toInteger (CTime t) = toInteger t<br>
    <br>
    I think this and the other trivial instances should just go right
    into Foreign.C.Types for all the "numeric" types in Foreign.C.Types.
    Any thoughts to the contrary?<br>
    <br>
    Jeff<br>
  </body>
</html>