for package:streaming-bytestring

for xs f applies f to each chunk in the stream, and concatenates the resulting streams. Generalised in 0.2.4 to match streaming: the callback's (ignored) return value can be of any type.
This is similar to withForeignPtr but comes with an important caveat: the user must guarantee that the continuation does not diverge (e.g. loop or throw an exception). In exchange for this loss of generality, this function offers the ability of GHC to optimise more aggressively. Specifically, applications of the form: unsafeWithForeignPtr fptr (forever something) See GHC issue #17760 for more information about the unsoundness behavior that this function can result in.