Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example does not seem to work #1

Open
chrissound opened this issue May 1, 2018 · 1 comment
Open

Example does not seem to work #1

chrissound opened this issue May 1, 2018 · 1 comment

Comments

@chrissound
Copy link

/home/chris/Projects/Haskell/wrecker/app/Main.hs:14:7: error:
    • Couldn't match type ‘Response
                             bytestring-0.10.8.2:Data.ByteString.Lazy.Internal.ByteString’
                     with ‘()’
      Expected type: Environment -> IO ()
        Actual type: Environment
                     -> IO
                          (Response
                             bytestring-0.10.8.2:Data.ByteString.Lazy.Internal.ByteString)
    • In the expression:
        withWreq $ \ sess -> do get sess "https://trycatchchris.co.uk"
      In the expression:
        ("first page", 
         withWreq $ \ sess -> do get sess "https://trycatchchris.co.uk")
      In the first argument of ‘defaultMain’, namely
        ‘[("first page", withWreq $ \ sess -> do ...)]’
   |
14 |     , withWreq $ \sess -> do
   |       ^^^^^^^^^^^^^^^^^^^^^^...

app/Main.hs

import Control.Exception
import Control.Monad (void)
import Data.Monoid
import Network.HTTP.Client
import Network.HTTP.Client.TLS (tlsManagerSettings)
import Options.Applicative
import Wrecker
import Wrecker.Options
import Network.Wreq.Wrecker

main :: IO ()
main = defaultMain
  [ ( "first page"
    , withWreq $ \sess -> do
        get sess "https://trycatchchris.co.uk"
    )
  ]
@lorenzo
Copy link
Owner

lorenzo commented May 1, 2018

Thanks for reporting, I will try to use the example and fix it shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants