Hot answers tagged

4

Perhaps you could wrap bare Sockets in an auxiliary datatype that enabled buffering. Something like: data BufferedSocket = BufferedSocket [ByteString] Socket Then you could define your own recv function like recv :: BufferedSocket -> Int -> IO (BufferedSocket,ByteString) which looked at the buffer before actually trying to read data from the socket....


2

def bigcommerce_api_v3_get_customers_by_shop(shop, options = {}) Since you are only extracting a couple values from options here, consider using keyword params instead. It makes it more obvious what specific keys are used by the method, without needing to dig into the method body. raise if params['page'] || params['limit'] # prevent manual pagination ...


Only top voted, non community-wiki answers of a minimum length are eligible