withForeignPtr package:streamly-core