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:
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