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
Unagi.Unboxed could be modified fairly easily to use a payload that matches the internals of either Text or ByteString. I'm a little bit sketchy on details but this could accommodate some pretty interesting and very efficient functions, like:
something similar for ByteString (is there a class for types convertable to ByteString?)
concurrent Text and/or ByteString readers, something like:
reader :: Text -> IO TextReader
takeText :: Int -> TextReader -> IO Text
functions like the above but where the inputs are already Text. This case would involve efficient memory copies into the unagi array; I'm not sure if this makes more or less sense than functions describes above which would convert and write directly into the unagi array.
Please comment with your particular use case if you need something like these.
The text was updated successfully, but these errors were encountered:
(is there a class for types convertable to ByteString?)
So what this is almost just Builder, where we could use a BufferWriter to write the buffer to our array, for an interface like:
writeChan :: ChanBytesString -> Builder -> IO ()
The only issue though is that we want (an O(1), preferably) function:
builderLength :: Builder -> Int
i.e. the amount of allocation needs to be statically known (so we know how much to increment our counters).
I think this requires a new library, but buffer-builder seems to be almost there already, and would at least be a good place to start a fork if the required changes aren't possible.
Unagi.Unboxed
could be modified fairly easily to use a payload that matches the internals of eitherText
orByteString
. I'm a little bit sketchy on details but this could accommodate some pretty interesting and very efficient functions, like:a concurrent builder for
Text
, something like:something similar for
ByteString
(is there a class for types convertable to ByteString?)concurrent Text and/or ByteString readers, something like:
functions like the above but where the inputs are already
Text
. This case would involve efficient memory copies into the unagi array; I'm not sure if this makes more or less sense than functions describes above which would convert and write directly into the unagi array.Please comment with your particular use case if you need something like these.
The text was updated successfully, but these errors were encountered: