turtle icon indicating copy to clipboard operation
turtle copied to clipboard

Add ByteString.Lazy utilities

Open berewt opened this issue 7 years ago • 6 comments

The starting point was a similar issue from the one raised in #209. Compared to the solution proposed in the thread, I'd prefer to go for a whole set of utilities for ByteString.Lazy. It allows almost the same shell facilities than the strict version, except that chunks are meaningless here.

berewt avatar Nov 21 '17 22:11 berewt

Wow, thanks for doing this! Give me a day or two to review this more closely, but I approve of the overall direction of this

Gabriella439 avatar Nov 21 '17 23:11 Gabriella439

Regarding the signature changes: yep, I forgot to transitively generalise the functions that depends on inhandle, thanks.

Regarding the stream / streamWithErr, maybe I should only keep the strict version and rename them as stream and streamWithErr, as the strict names can be misleading, what do you think about it?

berewt avatar Nov 24 '17 10:11 berewt

Yeah, I agree that they don't need the strict in the names for this module

Gabriella439 avatar Nov 24 '17 18:11 Gabriella439

One more question then, if we remove stream / streamWithError in favour of systemStrict / systemStrictWithError, what do we do with function like inProc, that was previously relying on stream, and will now use systemStrict:

  1. keep their signature as is and discard the ExitCode;
  2. change them, to include the ExitCode?

berewt avatar Nov 24 '17 21:11 berewt

I think you don't even inproc any longer since proc and the new stream utility supersede it

Or you could rename the new stream utility to inproc instead for conceptual consistency

Gabriella439 avatar Nov 24 '17 21:11 Gabriella439

I finally decided to drop the in* function and went for a *Stream name instead. The names are consistent with the *Strict equivalent in Turtle.ByteString. Please do not hesitate to propose something else if you're not happy with the result, I'm not totally satisfied myself either. ;-)

berewt avatar Nov 24 '17 22:11 berewt