    {-# OPTIONS_GHC -Wno-orphans #-}

    module IsomorphismClass.Relations.DiffTimeAndNominalDiffTime where

    import Data.Time
    import IsomorphismClass.Classes
    import IsomorphismClass.Prelude

    instance IsomorphicTo DiffTime NominalDiffTime where
      to :: NominalDiffTime -> DiffTime
    to = Integer -> DiffTime
    picosecondsToDiffTime (Integer -> DiffTime)
    -> (NominalDiffTime -> Integer) -> NominalDiffTime -> DiffTime
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    forall {k} (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
    Category cat =>
    cat b c -> cat a b -> cat a c
    . Pico -> Integer
    picoToInteger (Pico -> Integer)
    -> (NominalDiffTime -> Pico) -> NominalDiffTime -> Integer
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    forall {k} (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
    Category cat =>
    cat b c -> cat a b -> cat a c
    . NominalDiffTime -> Pico
    nominalDiffTimeToSeconds
        where
          picoToInteger :: Pico -> Integer
          picoToInteger :: Pico -> Integer
    picoToInteger (MkFixed Integer
    p) = Integer
    p

    instance IsomorphicTo NominalDiffTime DiffTime where
      to :: DiffTime -> NominalDiffTime
    to = Pico -> NominalDiffTime
    secondsToNominalDiffTime (Pico -> NominalDiffTime)
    -> (DiffTime -> Pico) -> DiffTime -> NominalDiffTime
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    forall {k} (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
    Category cat =>
    cat b c -> cat a b -> cat a c
    . Integer -> Pico
    forall k (a :: k). Integer -> Fixed a
    MkFixed (Integer -> Pico) -> (DiffTime -> Integer) -> DiffTime -> Pico
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    forall {k} (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
    Category cat =>
    cat b c -> cat a b -> cat a c
    . DiffTime -> Integer
    diffTimeToPicoseconds