-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Functionality to Data.Conduit.Text
#37
Comments
I actually have most of the code written for this now but have to wait for haskell/text#26 so I don't know if I can get this in for |
Personally, I never like using the default system encoding, and prefer to have to explicitly convert to/from Unicode. But that's just me. One issue you'll run into for this is implementing sourceFile properly for Windows. We have separate code that doesn't go via a Handle to avoid some file locking issues, and there's no easy way to determine the correct encoding. We could of course just assume UTF-8. |
How about a Assuming UTF-8 for Windows on the non-explicit functions sounds fair. I should be able to send in a patch for the With-family soon since it won't require the patch to |
Sounds good to me, thank you! |
Any updates here? |
Oh, I had completely forgot about this since I went out of state for a week or two and didn't have time to work on it. I think its mostly done or done but not submitted; I'll check this out later. |
There's a lot to be wishful for in
Data.Conduit.Text
. Some shortcomings (in my opinion) of thetext
API make a few of these a bit difficult to implement (see haskell/text#25).The most evident to me is that there should be a way to sink and source
Text
in a similar way toByteString
s. However, you would have to use one of the specific decodings or manually detect the system locale, which is ugly. We could do it that way (which is what the patch, when I finish it hopefully tonight, will do), but it would be preferable to avoid theByteString
s all together.I propose the following, in conflict with the
Data.Conduit.ByteString
API (which makes since given thatData.Text
andData.ByteString
also conflict each other):Notably I left out
sourceFileRange
because that seems more specialized toward binary data.(Also, lack of
conduitHandle
and friends seems odd. Any reason for this?)Any comments are welcome.
The text was updated successfully, but these errors were encountered: