main :: IO ()
main = withFile "hello.tar" WriteMode $ \h ->
  runEffect $
    (wrap . tarEntries >-> writeTar >-> forever . writeHandle h >-> discard) ()

 where

  tarEntries () = do
    now <- lift getCurrentTime
    writeDirectoryEntry "text" 0 0 0 now
    writeFileEntry "text/hello" 0 0 0 now <-<
      (wrap . const (respond (encodeUtf8 "Hello!"))) $ ()
main :: IO ()
main = withFile "hello.tar" WriteMode $ \h ->
  runEffect $
    (wrap . tarEntries >-> writeTar >-> forever . writeHandle h >-> discard) ()

 where

  tarEntries () = do
    now <- lift getCurrentTime
    writeDirectoryEntry "text" 0 0 0 now
    writeFileEntry "text/hello" 0 0 0 now <-<
      (wrap . const (respond (encodeUtf8 "Hello!"))) $ ()
main = withFile "hello.tar" WriteMode $ \h ->
  runEffect $
    (wrap . tarEntries >-> writeTar >-> forever . writeHandle h >-> discard) ()

 where

  tarEntries () = do
    now <- lift getCurrentTime
    writeDirectoryEntry "text" 0 0 0 now
    writeFileEntry "text/hello" 0 0 0 now <-<
      (wrap . const (respond (encodeUtf8 "Hello!"))) $ ()