[Haskell-cafe] System.IO but not with Data.String?

Hilco Wijbenga hilco.wijbenga at gmail.com
Fri May 10 01:47:18 UTC 2024


Yes, thank you. I was aware of that but AFAICT, it still uses FilePath
(i.e. String) and _that_ is what I want to avoid.

On Thu, May 9, 2024 at 6:33 PM Brent Yorgey <byorgey at gmail.com> wrote:
>
> There is also e.g. the Data.Text.IO module from the text package, for doing file I/O and other such things with Text instead of String.
>
> -Brent
>
>
> On Thu, May 9, 2024 at 2:29 PM Hilco Wijbenga <hilco.wijbenga at gmail.com> wrote:
>>
>> Hi all,
>>
>> We have Text and ByteString as alternatives to String but as soon as
>> you want to do anything IO related (read a file, get a directory's
>> content, et cetera) it seems your only option is to use String.
>>
>> For an occasional IO action, this is obviously irrelevant but for a
>> compiler, a build system, or anything else that does a lot of IO this
>> seems like it would be(come) an issue. So I was wondering what would
>> be involved in adding (portable) support for System.IO with an
>> alternative to String (this alternative does not necessarily need to
>> be Text or ByteString).
>>
>> I did a little bit of research into how GHC handles this and there
>> appear to be several other String types in the GHC tree, including
>> ByteString(?). How feasible is an alternative System.IO API? How tied
>> to GHC would such an alternative need to be? To be clear, I am not
>> looking to _replace_ System.IO but to _add_ an alternative API (and
>> not a wrapper that maps to/from String).
>>
>> Please do not assume I necessarily know what I am talking about!
>> Especially, when it comes to the "portable" part. :-)
>>
>> Cheers,
>> Hilco
>> _______________________________________________
>> Haskell-Cafe mailing list
>> To (un)subscribe, modify options or view archives go to:
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>> Only members subscribed via the mailman list are allowed to post.


More information about the Haskell-Cafe mailing list