Move ArchiveResult into GHCup.Utils.Tar.Types
So a module that wants to import ArchiveResult doesn't have to worry about CPP.
This commit is contained in:
@@ -14,7 +14,7 @@ Portability : portable
|
||||
-}
|
||||
module GHCup.Utils.Tar where
|
||||
|
||||
import GHCup.Types
|
||||
import GHCup.Utils.Tar.Types ( ArchiveResult(..) )
|
||||
import GHCup.Errors
|
||||
import GHCup.Prelude
|
||||
import GHCup.Prelude.Logger.Internal
|
||||
@@ -31,7 +31,9 @@ import Codec.Archive.Zip
|
||||
import qualified Codec.Archive.Tar as Tar
|
||||
import qualified Codec.Archive.Tar.Entry as Tar
|
||||
#else
|
||||
import Codec.Archive hiding ( Directory )
|
||||
import Codec.Archive hiding ( Directory
|
||||
, ArchiveResult -- imported from "GHCup.Utils.Tar.Types"
|
||||
)
|
||||
#endif
|
||||
|
||||
import qualified Codec.Compression.BZip as BZip
|
||||
|
||||
31
lib/GHCup/Utils/Tar/Types.hs
Normal file
31
lib/GHCup/Utils/Tar/Types.hs
Normal file
@@ -0,0 +1,31 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
|
||||
module GHCup.Utils.Tar.Types
|
||||
( ArchiveResult(..)
|
||||
)
|
||||
where
|
||||
|
||||
#if defined(TAR)
|
||||
|
||||
import Control.Exception ( Exception )
|
||||
import Control.DeepSeq ( NFData )
|
||||
import qualified GHC.Generics as GHC
|
||||
|
||||
data ArchiveResult = ArchiveFatal
|
||||
| ArchiveFailed
|
||||
| ArchiveWarn
|
||||
| ArchiveRetry
|
||||
| ArchiveOk
|
||||
| ArchiveEOF
|
||||
deriving (Eq, Show, GHC.Generic)
|
||||
|
||||
instance NFData ArchiveResult
|
||||
|
||||
instance Exception ArchiveResult
|
||||
|
||||
#else
|
||||
|
||||
import Codec.Archive ( ArchiveResult(..) )
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user