This is an attempt to implement Tar_gz without requiring I/O. The idea is to describe fold with a GADT instead of using I/O functions directly. Tar_gz then maps these values to introduce the compression level. Finally, Tar_unix and Tar_lwt_unix reuse this GADT with a specific evaluation depending on the backend.
However, as far as Tar_lwt_unix is concerned, the user function cannot currently return an Lwt value. Several solutions exist. The one I've currently used is like the one for awa-ssh, a list of threads that grows (and that we have to resolve) according to the fold computation. Another solution is to make GADT more expressive with the Yallop trick, as I've done here.
/cc @hannesm on top of #140
This is an attempt to implement
Tar_gz
without requiring I/O. The idea is to describe fold with a GADT instead of using I/O functions directly.Tar_gz
then maps these values to introduce the compression level. Finally,Tar_unix
andTar_lwt_unix
reuse this GADT with a specific evaluation depending on the backend.However, as far as
Tar_lwt_unix
is concerned, the user function cannot currently return an Lwt value. Several solutions exist. The one I've currently used is like the one forawa-ssh
, a list of threads that grows (and that we have to resolve) according to the fold computation. Another solution is to make GADT more expressive with the Yallop trick, as I've done here.