File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ module Codec.Archive.Tar.Types (
76
76
unfoldEntriesM ,
77
77
) where
78
78
79
+ import Data.Bifunctor (Bifunctor , bimap )
79
80
import Data.Int (Int64 )
80
81
import Data.List.NonEmpty (NonEmpty (.. ))
81
82
import Data.Monoid (Monoid (.. ))
@@ -145,7 +146,18 @@ data GenEntry tarPath linkTarget = Entry {
145
146
-- | The tar format the archive is using.
146
147
entryFormat :: ! Format
147
148
}
148
- deriving (Eq , Show )
149
+ deriving
150
+ ( Eq
151
+ , Show
152
+ , Functor -- ^ @since 0.6.4.0
153
+ )
154
+
155
+ -- | @since 0.6.4.0
156
+ instance Bifunctor GenEntry where
157
+ bimap f g e = e
158
+ { entryTarPath = f (entryTarPath e)
159
+ , entryContent = fmap g (entryContent e)
160
+ }
149
161
150
162
-- | Monomorphic tar archive entry, ready for serialization / deserialization.
151
163
--
@@ -178,7 +190,12 @@ data GenEntryContent linkTarget
178
190
| NamedPipe
179
191
| OtherEntryType {- # UNPACK #-} !TypeCode LBS. ByteString
180
192
{- # UNPACK #-} !FileSize
181
- deriving (Eq , Ord , Show )
193
+ deriving
194
+ ( Eq
195
+ , Ord
196
+ , Show
197
+ , Functor -- ^ @since 0.6.4.0
198
+ )
182
199
183
200
-- | Monomorphic content of a tar archive entry,
184
201
-- ready for serialization / deserialization.
You can’t perform that action at this time.
0 commit comments