-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Compatibility with old-time for the time package
--   
--   Compatibility with the <a>old-time</a> package for the "new"
--   <a>time</a> package.
@package time-compat
@version 0.1.0.3


-- | Compatibility with the <a>old-time</a> package for the "new"
--   <a>time</a> package.
--   
--   This is useful for writing portable code; in particular, if you're
--   using the <a>directory</a> package and you want your code to build
--   with both GHC 7.6 and earlier versions. The version of
--   <tt>directory</tt> used with GHC 7.6 changed a dependency from
--   <tt>old-time</tt> to <tt>time</tt> which means its
--   <tt>getModificationTime</tt> function now returns a <a>UTCTime</a>
--   instead of a <a>ClockTime</a>. This type affects the public API of
--   many libraries that use it. To make such libraries portable, port your
--   code to use the <tt>time</tt> package and to only rely on
--   <a>UTCTime</a> in its public API, and call <a>toUTCTime</a> on the
--   values returned by functions like <tt>getModificationTime</tt>, for
--   example:
--   
--   <pre>
--   fmap toUTCTime getModificationTime
--   </pre>
--   
--   If you're using <tt>directory-1.2</tt>, <a>toUTCTime</a> will just be
--   <a>id</a> and the original value is returned intact. If you're using
--   an older <tt>directory</tt>, for example because you're building with
--   GHC 7.4, the <a>ClockTime</a> returned by <tt>getModificationTime</tt>
--   will be converted to a <a>UTCTime</a> and will be compatible with your
--   code ported to the new <tt>time</tt> package.
module Data.Time.Compat
class ToUTCTime a
toUTCTime :: ToUTCTime a => a -> UTCTime
instance Data.Time.Compat.ToUTCTime Data.Time.Clock.Internal.UTCTime.UTCTime
instance Data.Time.Compat.ToUTCTime System.Time.ClockTime
instance Data.Time.Compat.ToUTCTime System.Time.CalendarTime
