Search code examples
stringnetwork-programminghaskellbytestring

Where is Network.Socket.ByteString.Lazy's sendTo?


Both Network.Socket.ByteString and Network.Socket.ByteString.Lazy have a send function.

Network.Socket.ByteString has a sendTo function, but Network.Socket.ByteString.Lazy doesn't.

How can I use Network.Socket.ByteString's sendTo with a Lazy.ByteString or Network.Socket.ByteString.Lazy's send function. (i.e. how do I tell it where to send the packet.)

Can anyone recommend a good tutorial on Haskell's Strings, BytesStrings. Lazy.ByteStrings, etc. as I find them very confusing (coming from a Java/Python background).


Solution

  • Note that sendTo is strict in the data sent, and so there's no real logic to passing it a lazy bytestring. That's why the function only exists on strict bytestrings.