Rust has no trouble parsing, but as I'm only human I have trouble parsing the following error message:
= note: required because of the requirements on the impl of futures::Future
for futures::MapErr<futures::AndThen<tokio_tungstenite::AcceptAsync<tokio::net::TcpStream, tokio_tungstenite::tungstenite::handshake::server::NoCallback>, server::connection::Connection<std::sync::Arc<std::sync::RwLock<T>>, tokio_tungstenite::WebSocketStream<tokio::net::TcpStream>>, [closure@redacted>, [closure@redacted]>
Would it be great if the types were more readable instead of manually having to unnpack them in a text editor to figure out what they are?
Below are a few mockups of how the above type could look. I'd like to poll and see which formatting people prefer.
- I'm fine parsing rust error types, hook me up to std::in
- Rainbow coloring of nested types
- Graduated shading of nested types (in hues of blue?)
- Format types nicely like
{:#?}
does but for types. - Time for something completely different (comment below)
0 voters
Rainbow and nested blue might look something like this:
Formatting of the type in a {:#?}
style might look something like this:
= note: required because of the requirements on the impl of `futures::Future` for `futures::MapErr<
futures::AndThen<
futures::future::FromErr<
tokio_tungstenite::AcceptAsync<
tokio::net::TcpStream,
tokio_tungstenite::tungstenite::handshake::server::NoCallback>,
tokio_tungstenite::tungstenite::Error>,
server::connection::Connection<
std::sync::Arc<
std::sync::RwLock<T>>,
tokio_tungstenite::WebSocketStream<tokio::net::TcpStream>>,
[closure@redacted]>,
[closure@redacted]>`
I'm sure other languages would have just said it's good enough already, and maybe that's true, but is it the best we can do? Rust loves types, so being able to visualise complex types well is important. I'm really keen to hear other suggestions (however wierd and wacky) of what we could do to make complex types more readable.