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
Libraries like aeson use ByteString and things like JavaScript.Web.WebSocket use ArrayBuffer. Converting from one to the other seems unduly difficult.
For example, I can used, fromByteString :: ByteString -> (Buffer, Int, Int) to get a Buffer from a ByteString and getArrayBuffer :: SomeBuffer any -> SomeArrayBuffer any to convert the Buffer to an ArrayBuffer. Except, that is not good enough because it does not use the offset and length values that fromByteString returns. And I can not seem to find a way to use them. I thought maybe I could use ArrayBuffer.slice except it is not exported.
It seems to me that ByteString <=> ArrayBuffer conversion might common enough that helper functions should provided that do it in a single step?
The text was updated successfully, but these errors were encountered:
Libraries like
aeson
useByteString
and things likeJavaScript.Web.WebSocket
useArrayBuffer
. Converting from one to the other seems unduly difficult.For example, I can used,
fromByteString :: ByteString -> (Buffer, Int, Int)
to get aBuffer
from aByteString
andgetArrayBuffer :: SomeBuffer any -> SomeArrayBuffer any
to convert theBuffer
to anArrayBuffer
. Except, that is not good enough because it does not use theoffset
andlength
values thatfromByteString
returns. And I can not seem to find a way to use them. I thought maybe I could useArrayBuffer.slice
except it is not exported.It seems to me that
ByteString <=> ArrayBuffer
conversion might common enough that helper functions should provided that do it in a single step?The text was updated successfully, but these errors were encountered: