I am writing function set wor working with HTTP requests and need to create a set of Exceptions for handling failures. Here it is
data HStream ty => ErrorResponse ty = ErrorResponse (Response ty)
data HStream ty => HttpException ty = WrongURIException String | ConnException ConnError | RequestException (ErrorResponse ty)
instance HStream ty => Exception (HttpException ty)
where WrongURIException
corresponds to malformed uri, ConnException
to errors in TCP stack and RequestException to handle responses with non-2xx response codes.
Before declaring instance Exception
on line 3 I should derive Typeable but I'm lost in types. How should I it?