In http-conduit version 2.0+ I want to create a custom Manager.
The documentation states that defaultManagerSettings should be used in newManager.
import Network.HTTP.Conduit
main = do manager <- newManager defaultManagerSettings
print $ content
However, when trying to run it I get the following error:
conduittest.hs:3:33:
Not in scope: `defaultManagerSettings'
Perhaps you meant `conduitManagerSettings' (imported from Network.HTTP.Conduit)
Shall I use conduitManagerSettings instead? If not, where can I import defaultManagerSettings from?
Note: This question intentionally does not show further research effort, because it was immediately answered in a Q&A-style manner.
As listed in the
newManagerdocs, you can importdefaultManagerSettingslike this:Let's have a look what
conduitManagerSettingsis:In
Network.HTTP.Client.TLS,tlsManagerSettingsis defined as follows:Ok, so nothing special here.
defis from theData.Defaultmodule and therefore defines the default instance. HoweverdefaultManagerSettingsspecifies all default values.I wasn't able to track down where the
instance Default ManagerSettingsresides. However I think it is safe to assume thatmkManagerSettings def Nothinghas the same settings asdefaultManagerSettings.I personally recommend to use
defaultManagerSettings, because any of these behaviours might change in the future.