try is returning Either instead of IO (Either ex a)
问题 I'm trying to handle exceptions from my request parser: go bs = case try $ parseRequest reader bs secure of Left ex -> exceptionHandler writer ex Right (request, bs') -> do sendResponse writer =<< app request go bs' But I have an issue when using try : Couldn't match expected type `IO (Either e0 (Request, ByteString))' with actual type `Either t0 t1' In the pattern: Left ex In a case alternative: Left ex -> exceptionHandler writer ex In the expression: case try $ parseRequest reader bs secure