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
newManager
docs, you can importdefaultManagerSettings
like this:Let's have a look what
conduitManagerSettings
is:In
Network.HTTP.Client.TLS
,tlsManagerSettings
is defined as follows:Ok, so nothing special here.
def
is from theData.Default
module and therefore defines the default instance. HoweverdefaultManagerSettings
specifies all default values.I wasn't able to track down where the
instance Default ManagerSettings
resides. However I think it is safe to assume thatmkManagerSettings def Nothing
has the same settings asdefaultManagerSettings
.I personally recommend to use
defaultManagerSettings
, because any of these behaviours might change in the future.