diff options
-rw-r--r-- | anissue.cabal | 1 | ||||
-rw-r--r-- | app/Git.hs | 25 |
2 files changed, 4 insertions, 22 deletions
diff --git a/anissue.cabal b/anissue.cabal index b6929d8..5ebda20 100644 --- a/anissue.cabal +++ b/anissue.cabal @@ -105,6 +105,7 @@ executable anissue aeson, attoparsec, binary, + binary-instances, bytestring, cmark, containers, @@ -1,5 +1,3 @@ -{-# OPTIONS_GHC -fno-warn-orphans #-} - module Git ( module Git.CommitHash, getCommitHashes, @@ -13,9 +11,9 @@ module Git where import Control.Exception (IOException, catch, throw, throwIO) -import Data.Binary (Binary, Put, get, put) +import Data.Binary (Binary) +import Data.Binary.Instances () import Data.ByteString.Lazy qualified as LB -import Data.Fixed (Pico) import Data.List.NonEmpty (NonEmpty) import Data.List.NonEmpty qualified as N import Data.Maybe (fromMaybe) @@ -24,8 +22,7 @@ import Data.Text.Encoding qualified as T import Data.Text.Lazy qualified as LT import Data.Text.Lazy.Encoding qualified as LT import Data.Text.Lazy.IO qualified as LT -import Data.Time.Calendar (Day (..), toModifiedJulianDay) -import Data.Time.Clock (DiffTime, UTCTime (..), getCurrentTime, picosecondsToDiffTime) +import Data.Time.Clock (UTCTime, getCurrentTime) import Exception qualified as E import GHC.Generics (Generic) import Git.CommitHash @@ -62,22 +59,6 @@ data Author = Author } deriving (Show, Generic, Binary, Eq) --- XXX These are taken from `Data.Binary.Orphans` [1]. I cannot get importing --- the instance from the package to work.. so we use `-fno-warn-orphans` here. --- --- [1] https://hackage.haskell.org/package/binary-orphans-0.1.5.1/docs/src/Data-Binary-Orphans.html#line-132 -instance Binary UTCTime where - get = UTCTime <$> get <*> get - put (UTCTime d dt) = put d >> put dt - -instance Binary Day where - get = fmap ModifiedJulianDay get - put = put . toModifiedJulianDay - -instance Binary DiffTime where - get = fmap picosecondsToDiffTime get - put = (put :: Pico -> Put) . realToFrac - getCommitOf :: CommitHash -> IO Commit getCommitOf commitHash@WorkingTree = do date <- getCurrentTime |