You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, you're absolutely right. I'll try loosening that, and adding some more instances.
Regarding binary, I could add an instance for getting an Aff e Buffer, as with String.
For streaming, exposing the request's Stream will do for now. In the spirit of Hyper, the stream should only be allowed to be read once (it cannot be read twice, but you could get a compile-time error if you try). That would probably require some other design than just handing back the Readable stream -- like hiding the streaming within the indexed monad and track whether you've been streaming or not. Any thoughts?
Well, where "read once" means "read until exhausted." Stream has a godforsaken Node.js-style callback API, so you can't really demand to read it twice, right? It'll just stop calling you when there's nothing to read.
Regarding this issue, it should only be about the String instance checking the Content-Type header and using that when doing toString on the buffer. Buffers in general, and streaming, are separate issues, but we already have the PRs open. 👍
Activity
no-longer-on-githu-b commentedon May 15, 2017
It should also support binary data, and streaming, and MIME in general. I think the fundep on
ReadableBodyneeds to be removed for this.owickstrom commentedon May 16, 2017
@rightfold Agreed. Not sure where you mean the functional dependency is, though?
no-longer-on-githu-b commentedon May 16, 2017
Fundep from body reader type to body type.
owickstrom commentedon May 17, 2017
Yes, you're absolutely right. I'll try loosening that, and adding some more instances.
Regarding binary, I could add an instance for getting an
Aff e Buffer, as withString.For streaming, exposing the request's
Streamwill do for now. In the spirit of Hyper, the stream should only be allowed to be read once (it cannot be read twice, but you could get a compile-time error if you try). That would probably require some other design than just handing back theReadablestream -- like hiding the streaming within the indexed monad and track whether you've been streaming or not. Any thoughts?no-longer-on-githu-b commentedon May 17, 2017
Well, where "read once" means "read until exhausted."
Streamhas a godforsaken Node.js-style callback API, so you can't really demand to read it twice, right? It'll just stop calling you when there's nothing to read.owickstrom commentedon May 18, 2017
Regarding this issue, it should only be about the
Stringinstance checking the Content-Type header and using that when doingtoStringon the buffer. Buffers in general, and streaming, are separate issues, but we already have the PRs open. 👍