Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- extractTarGzFile :: FilePath -> FilePath -> FilePath -> IO ()
- type Entry = GenEntry TarPath LinkTarget
- type Entries e = GenEntries TarPath LinkTarget e
- data GenEntries tarPath linkTarget e
- = Next (GenEntry tarPath linkTarget) (GenEntries tarPath linkTarget e)
- | Done
- | Fail e
- data GenEntryContent linkTarget
- = NormalFile ByteString !FileSize
- | Directory
- | SymbolicLink !linkTarget
- | HardLink !linkTarget
- | CharacterDevice !DevMajor !DevMinor
- | BlockDevice !DevMajor !DevMinor
- | NamedPipe
- | OtherEntryType !TypeCode ByteString !FileSize
- entryContent :: GenEntry tarPath linkTarget -> GenEntryContent linkTarget
Documentation
type Entry = GenEntry TarPath LinkTarget #
Monomorphic tar archive entry, ready for serialization / deserialization.
type Entries e = GenEntries TarPath LinkTarget e #
Monomorphic sequence of archive entries, ready for serialization / deserialization.
data GenEntries tarPath linkTarget e #
Polymorphic sequence of archive entries.
High-level interfaces
commonly work with GenEntries
FilePath
FilePath
,
while low-level ones use GenEntries
TarPath
LinkTarget
.
The point of this type as opposed to just using a list is that it makes the failure case explicit. We need this because the sequence of entries we get from reading a tarball can include errors.
Converting from a list can be done with just foldr Next Done
. Converting
back into a list can be done with foldEntries
however in that case you
must be prepared to handle the Fail
case inherent in the Entries
type.
The Monoid
instance lets you concatenate archives or append entries to an
archive.
Since: tar-0.6.0.0
Next (GenEntry tarPath linkTarget) (GenEntries tarPath linkTarget e) infixr 5 | |
Done | |
Fail e |
Instances
Foldable (GenEntries tarPath linkTarget) | Since: tar-0.6.0.0 |
Defined in Codec.Archive.Tar.Types fold :: Monoid m => GenEntries tarPath linkTarget m -> m # foldMap :: Monoid m => (a -> m) -> GenEntries tarPath linkTarget a -> m # foldMap' :: Monoid m => (a -> m) -> GenEntries tarPath linkTarget a -> m # foldr :: (a -> b -> b) -> b -> GenEntries tarPath linkTarget a -> b # foldr' :: (a -> b -> b) -> b -> GenEntries tarPath linkTarget a -> b # foldl :: (b -> a -> b) -> b -> GenEntries tarPath linkTarget a -> b # foldl' :: (b -> a -> b) -> b -> GenEntries tarPath linkTarget a -> b # foldr1 :: (a -> a -> a) -> GenEntries tarPath linkTarget a -> a # foldl1 :: (a -> a -> a) -> GenEntries tarPath linkTarget a -> a # toList :: GenEntries tarPath linkTarget a -> [a] # null :: GenEntries tarPath linkTarget a -> Bool # length :: GenEntries tarPath linkTarget a -> Int # elem :: Eq a => a -> GenEntries tarPath linkTarget a -> Bool # maximum :: Ord a => GenEntries tarPath linkTarget a -> a # minimum :: Ord a => GenEntries tarPath linkTarget a -> a # sum :: Num a => GenEntries tarPath linkTarget a -> a # product :: Num a => GenEntries tarPath linkTarget a -> a # | |
Traversable (GenEntries tarPath linkTarget) | Since: tar-0.6.0.0 |
Defined in Codec.Archive.Tar.Types traverse :: Applicative f => (a -> f b) -> GenEntries tarPath linkTarget a -> f (GenEntries tarPath linkTarget b) # sequenceA :: Applicative f => GenEntries tarPath linkTarget (f a) -> f (GenEntries tarPath linkTarget a) # mapM :: Monad m => (a -> m b) -> GenEntries tarPath linkTarget a -> m (GenEntries tarPath linkTarget b) # sequence :: Monad m => GenEntries tarPath linkTarget (m a) -> m (GenEntries tarPath linkTarget a) # | |
Functor (GenEntries tarPath linkTarget) | |
Defined in Codec.Archive.Tar.Types fmap :: (a -> b) -> GenEntries tarPath linkTarget a -> GenEntries tarPath linkTarget b # (<$) :: a -> GenEntries tarPath linkTarget b -> GenEntries tarPath linkTarget a # | |
Monoid (GenEntries tarPath linkTarget e) | |
Defined in Codec.Archive.Tar.Types mempty :: GenEntries tarPath linkTarget e # mappend :: GenEntries tarPath linkTarget e -> GenEntries tarPath linkTarget e -> GenEntries tarPath linkTarget e # mconcat :: [GenEntries tarPath linkTarget e] -> GenEntries tarPath linkTarget e # | |
Semigroup (GenEntries tarPath linkTarget e) | Since: tar-0.5.1.0 |
Defined in Codec.Archive.Tar.Types (<>) :: GenEntries tarPath linkTarget e -> GenEntries tarPath linkTarget e -> GenEntries tarPath linkTarget e # sconcat :: NonEmpty (GenEntries tarPath linkTarget e) -> GenEntries tarPath linkTarget e # stimes :: Integral b => b -> GenEntries tarPath linkTarget e -> GenEntries tarPath linkTarget e # | |
(Show tarPath, Show linkTarget, Show e) => Show (GenEntries tarPath linkTarget e) | |
Defined in Codec.Archive.Tar.Types showsPrec :: Int -> GenEntries tarPath linkTarget e -> ShowS # show :: GenEntries tarPath linkTarget e -> String # showList :: [GenEntries tarPath linkTarget e] -> ShowS # | |
(NFData tarPath, NFData linkTarget, NFData e) => NFData (GenEntries tarPath linkTarget e) | |
Defined in Codec.Archive.Tar.Types rnf :: GenEntries tarPath linkTarget e -> () # | |
(Eq tarPath, Eq linkTarget, Eq e) => Eq (GenEntries tarPath linkTarget e) | |
Defined in Codec.Archive.Tar.Types (==) :: GenEntries tarPath linkTarget e -> GenEntries tarPath linkTarget e -> Bool # (/=) :: GenEntries tarPath linkTarget e -> GenEntries tarPath linkTarget e -> Bool # |
data GenEntryContent linkTarget #
Polymorphic content of a tar archive entry. High-level interfaces
commonly work with GenEntryContent
FilePath
,
while low-level ones use GenEntryContent
LinkTarget
.
Portable archives should contain only NormalFile
and Directory
.
Since: tar-0.6.0.0
NormalFile ByteString !FileSize | |
Directory | |
SymbolicLink !linkTarget | |
HardLink !linkTarget | |
CharacterDevice !DevMajor !DevMinor | |
BlockDevice !DevMajor !DevMinor | |
NamedPipe | |
OtherEntryType !TypeCode ByteString !FileSize |
Instances
entryContent :: GenEntry tarPath linkTarget -> GenEntryContent linkTarget #
The real content of the entry. For NormalFile
this includes the
file data. An entry usually contains a NormalFile
or a Directory
.
Orphan instances
(Exception a, Exception b) => Exception (Either a b) Source # | |
toException :: Either a b -> SomeException # fromException :: SomeException -> Maybe (Either a b) # displayException :: Either a b -> String # |