composewell / streamly

High performance, concurrent functional programming abstractions
https://streamly.composewell.com
Other
862 stars 66 forks source link

Plans for the Network module #439

Open harendra-kumar opened 4 years ago

harendra-kumar commented 4 years ago

"Streamly.Network.Socket" provides stream read/write operations using Arrays. Other than these operations we also need the socket/address types and also basic read/write operations that are not bytestring based to complete the whole repertoire of APIs for networking.

Currently we depend on the "network" package which uses bytestring for IO. Streamly does not depend on bytestring and uses Arrays instead for IO. We would like to have a clean separation of the low level socket/address types and APIs that are independent of bytestring.

We can separate the non-streaming/core networking types/APIs into separate modules and export those from streamly. For now we will keep depending on the "network" package and re-export the required types/APIs from separate modules within streamly, however, going forward we would either (1) need a split of the "network" package into a "core" package and a higher level package that requires bytestring or (2) go with networking types/modules that are independent of the network package.

I can think of the following modules for now (this may change):

1) Streamly.Network.Socket (existing streaming APIs for sockets) 2) Streamly.Network.Socket.IO (IO monad APIs for sockets) 3) Streamly.Network.Socket.Types (core types for networking)

If it is possible to split the "network" package then the last two modules are the ones that can go in the "network-core" package.

harendra-kumar commented 4 years ago

See also #533