Hi all,<br>I am trying to Network.HTTP to connect to a website and catch the error if the network is down. Here&#39;s what I have so far:<br><br>data Errors = DocumentParseError<br>            | WebsiteUnreachableError<br>
            | ISBNNotFoundError<br><br>respHTML&#39; :: ISBN -&gt; IO (Either Errors (IO String))<br>respHTML&#39; isbn =<br>    do<br>      rsp &lt;- simpleHTTP (getRequest $ &quot;<a href="http://isbndb.com/api/books.xml?results=details&amp;access_key=">http://isbndb.com/api/books.xml?results=details&amp;access_key=</a>&quot;<br>
                                        ++ key<br>                                        ++ &quot;&amp;index1=isbn&amp;value1=&quot;<br>                                        ++ isbn :: Request_String)<br>      return $ Right $ getResponseBody rsp<br>
                  `E.catch` (\(e :: E.SomeException ) -&gt;<br>                                 return $ Left $ WebsiteUnreachableError)<br><br>I get the following error when I load it into GHCI:<br>    Couldn&#39;t match expected type `[Char]&#39;<br>
           against inferred type `Either Errors b&#39;<br>      Expected type: IO String<br>      Inferred type: IO (Either Errors b)<br>    In the expression: return $ Left $ WebsiteUnreachableError<br>    In the second argument of `E.catch&#39;, namely<br>
        `(\ (e :: E.SomeException)<br>              -&gt; return $ Left $ WebsiteUnreachableError)&#39;<br>Failed, modules loaded: none.<br><br>Control.Exception.catch has the following signature : <br>catch :: forall a. IO a -&gt; (IOError -&gt; IO a) -&gt; IO a<br>
<br>I would expect that the handler function needs to return an IO (Either Errors (IO String)). Why is it trying to return an IO String?<br>