Merge pull request #6 from mboes/master

Extra instances for `Clock` and `TimeSpec`; courtesy of a fellow developer from the European capital of romance ;)
Use ghc-prim when GHC < 7.6
Merge pull request #8 from puffnfresh/master

Use ghc-prim when GHC < 7.6
Use ghc-prim when GHC < 7.6
Merge branch 'master' of github.com:corsis/clock
Use ghc-prim when GHC < 7.6; CS
Fix broken layout in .cabal (prevented the library from building)
Simpler Ord instance for TimeSpec.
clock.cabal: break up lines of extensions field.
Inline (|.) and (|^).
Use hsc2hs to determine field types, size of TimeSpec, alignment.

The alignment value was wrong. hsc2hs computes the correct value for us.
Mor importantly, the size of a long differs from platform to platform.
Whatever the size of a long, it usually exceeds the range of an Int.
Again, hsc2hs maps a C long to the correct Haskell type that fits, on
every architecture.

Int cannot be assumed to have the same range than that of a word
(pointer size), no matter the platform (see Haskell report - the
compiler is allowed to still some of the low order bits). So using Int
to represent a C long was incorrect.
Use alloca instead of malloc. Much more efficient.

See [GHC manual](https://www.haskell.org/ghc/docs/latest/html/users_guide/ffi-ghc.html)
concerning efficiency claim.
Use pre-field docstrings, rather than post-field docstrings, wrap.
Avoid haddock warning by exporting nsec,sec with TimeSpec.
Rename csec/ to more standard cbits/.
Move cross-platform clock abstraction from C to Haskell.

There are several reasons for this move. One is performance. For
compliant POSIX systems, time.h already provides all that we need,
without the need for wrapper functions. The C code used to define
a common cross-platform API, that each platform implemented differently.
But the problem with this approach is that GHC can't inline C wrapper
functions. The common API was introducing an extra layer of function
calls, but these cannot be eliminated by GHC, when it otherwise could if
the cross-platform API abstraction was done in Haskell instead.

The other reason is better portability and safety. Darwin and POSIX both
use struct timespec to encode clock readings. But because Windows does
not, the lowest common denominator was a two element array of longs.
These arrays were cast to timespec, but on some systems time_t is
32-bits, which we can't just assume to be the size of a long. On such
systsems casting would yield incorrect results. Not to mention that on
modern 32-bit systems time_t is long long, again yielding incorrect
results. Also, it's best not to rely on C's struct layout semantics to
match exactly that of a two-element array.
Mark internal helper functions for win32 as static.
Make the definition of TimeSpec architecture independent.

Previously, the definition of TimeSpec was in terms of architecture
dependent types (i.e. Int does not have the same size on 32-bit and
64-bit platforms).
Num instance for TimeSpec.
Add `diffTimeSpec`.