Add compressRec and compressFold